The Open Source Swiss Army Knife

/web_design/
/web_design/ + sub-categories
http://www.sirfsup.com/
web directory content
    
      

Not logged in
Chat Register Login
return to:  http:/www.sirfsup.com      /web_design 
Permalink: text-dec.htm
Title: add
article options : please login   |  print view

text-decoration

Value: none | [ underline || overline || line-through || blink ]
Initial: none
Applies to: all elements
Inherited: no, but see clarification below
Percentage values: N/A

This property describes decorations that are added to the text of an element. If the element has no text (e.g. the 'IMG' element in HTML) or is an empty element (e.g. ''), this property has no effect. A value of 'blink' causes the text to blink.

The color(s) required for the text decoration should be derived from the 'color' property value.

This property is not inherited, but elements should match their parent. E.g., if an element is underlined, the line should span the child elements.

A:link, A:visited, A:active { text-decoration: underline }

The color of the underlining will remain the same even if descendant elements have different 'color' values.

The example above would underline the text of all links (i.e., all 'A' elements with a 'HREF' attribute). UAs must recognize the keyword 'blink', but are not required to support the blink effect.

examples

<STYLE TYPE="text/css">

A { text-decoration: none;  }  
A.underline {text-decoration: underline}

</STYLE>

  1. no underlining
    <a href="../index.htm">not underlined link</a>
    not underlined link
  2. with underlining
    <a class=underline href="../index.htm">underlined link</a><br>
    
    underlined link

A { text-decoration: none; } gets translated to A:visited, A:hover, A:active { text-decoration: none; }?


Leave a Reply
Your Name:     anonymous
Your Email:
Website:  
Comments:

The author will be notified of your reply.
return to top