The text-decoration adds decorations to text in terms of underlining it or making blink and similar.

The text-decoration property contains following information:

  1. value: none, [underline, overline, line-through or blink] or inherit;
  2. initial: none;
  3. applies to: all elements;
  4. inherited: no;
  5. percentages: N/A;
  6. media: visual;
  7. computed value: initial or specified value.

The values overline, line-through and blink make a line above the text, a line through the text and make text blink respectively. The value underline is typically avoided considering that it underlines text which is generally used for hyperlinks.

The color of the line must match the color of the text itself as defined within that same element.

Sometimes we want to style hyperlinks by ourselves and we don't want them to be underlined (which is a default state for <a> tag); in such a case it is enough to add text-decoration property to that particular hyperlink or hyperlinks with value 'none'.


CSS text-decoration property example:


›› go to examples ››