XML technologies / CSS / Advanced websites with CSS / CSS property reference / text-decoration

(Excerpt from “CSS − Advanced websites with Cascading Stylesheets” by Rachel Andrew & Dan Shafer)

The property text-decoration describes the decoration of text elements. It can display text with an overline, underline, strikethrough or blinking effect.

Although this property is not inherited, decoration applies to the entire element and its descendants.

Inherited: no

Values

The following four constants, which can also be combined with spaces between them:

  • blink

  • line-through

  • overline

  • underline

The constant none removes all text decorations specified by parent or lower-priority rules (for example, the default underlining of hyperlinks).

Default value: none

Compatibility

CSS version: 1

Works in all CSS-capable browsers; the constant blink is not supported by Internet Explorer up to version 6.0.

Example

The following rule removes hyperlink underlining and replaces it with a dashed bottom border:

a:link, a:visited {
 text-decoration: none;
 border-bottom: 1px solid dashed;
}

  

 

 

 

back to top