From W3C Wiki
Jump to: navigation, search


The text-decoration property describes decorations that are added to the text of an element using the element's color.


Values none | [ underline || overline || line-through || blink ] | inherit
Initial value none
Applies to All elements
Inherited No

Point, Note

  • The decoration's color be set by the color property.


  • none
    Produces no text decoration.

  • underline
    Each line of text is underlined.

  • overline
    Each line of text has a line above it.

  • line-through
    Each line of text has a line through the middle.

  • blink
    Text blinks (alternates between visible and invisible).

  • inherit
    Takes the same specified value as the property for the element's parent.


Example A


p#no{ text-decoration: none; }
p#un{ text-decoration: underline; }
p#ov{ text-decoration: overline; }
p#th{ text-decoration: line-through; }
p#bl{ text-decoration: blink; }


  <p id="no">This is a paragraph(none)</p>
  <p id="un">This is a paragraph(underline)</p>
  <p id="ov">This is a paragraph(overline)</p>
  <p id="th">This is a paragraph(line-through)</p>
  <p id="bl">This is a paragraph(blink)</p>

Csslist2 text-decoration.png

CSS Reference

The CSS specification defines the text-decoration property in 16.3.1 Underlining, overlining, striking, and blinking.