The text-decoration adds decorations to text in terms of underlining it or making blink and similar.
The text-decoration property contains following information:
- value: none, [underline, overline, line-through or blink] or inherit;
- initial: none;
- applies to: all elements;
- inherited: no;
- percentages: N/A;
- media: visual;
- 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: