CSS Property text-decoration

text-decoration allows certain text effects such as underlining.


Initial value none
Inherited No.
Version CSS1
JavaScript syntax object.style.textDecoration="overline"
Applies to All elements.

CSS Syntax

text-decoration: blink | 
                 inherit | 
                 line-through | 
                 none | 
                 overline | 

Property Values

The property values are listed in the following table.

none a normal text. This is default
underline a line below the text
overline a line above the text
line-through a line through the text
blink a blinking text.
inherit inherit the text-decoration property from the parent element

Browser compatibility

text-decoration Yes Yes Yes Yes Yes


An example showing how to use text-decoration CSS property.

        a:link, a:visited, a:hover, a:active {
          text-decoration: underline;<!--  www  .j ava  2s .c o  m-->
          color: #6A5ACD;
          background-color: transparent;
      <li><a href="#">A</a></li>
      <li><a href="#">B</a></li>
      <li><a href="#">C</a></li>
      <li><a href="#">D</a></li>

Click to view the demo