text-decoration

Browser Internet Explorer Netscape Opera Safari Firefox
Version 5.5 6.0 7.0 8.0 8.0 9.0 7.0 8.0 9.2 9.5 1.3 2.0 3.1 1.5 2.0 3.0
Supported Partially Partially Partially ? Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes

Short information
CSS CSS1
Default value none
Inherited No
Applied To all elements
HTML analog <iU> <S> <STRIKE>
Reference to specification http://www.w3.org/TR/CSS21/text.html#propdef-text-decoration

Description
It adds appearance of the text in the form of its underlining, deletion, a line over the text and blinkings. It is possible to apply more than one style simultaneously listing values through a blank.

Syntax

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

Arguments
blink
It determines the blinking text. Such text disappears periodically about once a second then it appears on a former place again.
line-through
It creates a line-through text.
overline
The line is over the text.
underline
It determines an underlined text.
none
It cancels all effects including lines underlinings which are specified by default.

Example

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
 <head>
  <meta http-equiv="Content-Type" content="text/html; charset=windows-1251">
  <title>text-decoration</title>
  <style type="text/css">
   A { 
    text-decoration: none; /* Remove links' underlining */
   }
   A:hover { 
    text-decoration: underline; /* Add underlining 
                                   in the time of mouseover on the link */
   }
  </style> 
 </head> 
 <body>
 
  <p><a href="link1.html">Lorem ipsum dolor sit amet</a></p>
 
 </body>
</html>

Object model

[window.]document.getElementById("elementID").style.textDecoration
[window.]document.getElementById("elementID").style.textDecorationBlink
[window.]document.getElementById("elementID").style.textDecorationLineThrough
[window.]document.getElementById("elementID").style.textDecorationNone
[window.]document.getElementById("elementID").style.textDecorationOverLine
[window.]document.getElementById("elementID").style.textDecorationUnderline

Remark
Browser Internet Explorer allows to use the value "blink" but the text is shown as usual without blinking.
According to CSS specification if the formatting type is set for the element but doesn't for its herit the parent's properties will be passed on to built-in elements. If the underlined paragraph is used and not underlined object is placed in it dedicating the word with another color - all the paragraph words will be underlined including the words dedicated by another color. But for the browser Netscape 6 setting "text-decoration: none" removes all effects independent from parent element's decoration. In additional Netscape 6 doesn't spread parent element's decoration to child ones but pass on only underlining.
IT disaster recovery
Differential Backup
Cloud Technology
Cloud Computing