Add or remove text decorations: underline, overline or line through.
Syntax text-decoration: none | underline | overline | line-through | blink | inherit ;
none - Normal text. (default)
underline - Add a line below the text. (default for hyperlinks)
overline - Add a line above the text.
line-through - Add a line through the text.
blink - Make the text blink.
inherit - inherit from the parent element.
The CSS 2.1 specification allows web browsers to ignore text-decoration: blink in order to comply with accessibility guidelines. The CSS 3 specification defines text-decoration as a shorthand for text-decoration-line, text-decoration-color, and text-decoration-style, but there is almost no browser support for those yet.
Examples:
h1 { text-decoration: underline; }
.emw3class { text-decoration: blink; }
#emw3id { text-decoration: inherit; }
Try it:
In html documents the use of underline formatting is most often associated with hyperlinks. You may prefer to add emphasis with bold or italic. |
(CSS 1) Browser Support: All major browsers.
“Whenever you find yourself on the side of the majority, it is time to pause and reflect” ~ Mark Twain
Related:
font-weight - Normal, bold, bolder.
text-align - Horizontal alignment of text.
text-decoration-thickness - Set the stroke thickness of the text decoration (line-through, underline)
text-indent - Indent the first line in a text-block.
text-overflow - What should happen when text overflows the containing element.
text-shadow - Add a shadow to text.
text-transform - Change the capitalization of text.