Ronalds Vilciņš

text-decoration is a useful CSS shorthand

text-decoration is not just an on-or-off switch for underlines. It is shorthand for text-decoration-line, text-decoration-style, and text-decoration-color.

CSS
a {
  text-decoration: underline dotted blue;
}

This gives the link a blue, dotted underline in one declaration. You can write the three longhand properties separately when that is clearer, but the shorthand is handy for small rules like this one.

Filed under on

← Back to all articles