English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

CSS reference manual

CSS @rule (RULES)

CSS attribute大全

CSS3 text-decoration-Usage and examples of the line property

The text-decoration-The lineCSS property specifies what kind of pattern is added to the element. This property can accept one or more space-separated values.

The following table provides usage instructions and version history for this attribute, as well as its syntax in JavaScript scripts.

Default value:none
Applicable to:
All elements. It also applies to::first-letter and::first-line.
Inheritance:None
Animatable:No.See also Animation properties.
Version: CSS3new feature
JavaScript syntax:object.style.textDecorationLine="underline"

text-decoration-line usage syntax

The syntax of this attribute is as follows:

text-decoration-line: none | [ underline | overline | line-through | blink ] one or more values | initial | inherit

The following examples demonstrate how to use text-decoration-line attribute.

p {
    -moz-text-decoration-line: underline; /* Firefox */
    text-decoration-line: underline; 
}
p.multiple {
    -moz-text-decoration-line: underline overline; /* Firefox */
    text-decoration-line: underline overline; 
}
Test see‹/›

Attribute values

The following table describes the values of this attribute.

ValueDescription
noneText has no decoration. This is the default value.
underlineEach line of text has an underline.
overlineThere is a line above each line of text.
line-throughThere is a line in the middle of each line of text.
blinkMake the text blink (toggle between visible and invisible). This value is not recommended, and the recommended value isAnimations.
initialSet this attribute to its default value.
inheritIf specified, the associated elements adopt the text of their parent element-decoration-line attribute values.

Browser compatibility

text-decoration-line Most browsers do not support this attribute.

  • Firefox 6+ -moz-,36+

  • Google Chrome×

  • Internet Explorer ×

  • Apple Safari ×

  • Opera ×

Warning:text-decoration-line Most browsers currently do not support this attribute. It is best to avoid using this attribute.

Further reading

Please refer to the following tutorials:CSS text,CSS border.

Related attributes:text-decoration,text-decoration-color,text-decoration-style.