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

CSS Reference Manual

CSS @rules (RULES)

Comprehensive List of CSS Properties

CSS3 text-decoration-Usage and examples of the 'style' property

text-decoration-The 'style' CSS property specifies the line type to be used for text decoration.

Note: You can also use 'text'-The 'decoration' property sets the text-decoration-line.text-decoration attribute is text-decoration-line, text-decoration-style and text-decoration-The shorthand attribute of the color attribute.

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

Default Value:solid
Applies to:All elements. It also applies to ::first-letter and ::first-line
Inheritance:None
Animatable:No.See also Animation Attributes.
Version: CSS3new feature
JavaScript Syntax:object.style.textDecorationStyle="wavy"

text-decoration-The syntax of the style attribute.

The syntax of this attribute is as follows:

text-decoration-style: [ solid | double | dotted | dashed | wavy ] one or more values | initial | inherit

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

p {
    text-decoration: underline;
    -moz-text-decoration-style: dotted; /* Firefox */
    text-decoration-style: dotted; 
}
Test to see‹/›

Attribute Values

The following table describes the values of this attribute.

ValueDescription
solidThis line is displayed as a solid line. This is the default value.
doubleThis line is displayed as a double line.
dottedThis line is displayed as a dashed line.
dashedThis line is displayed as a dashed line.
wavyThis line is displayed as a wavy line.
initialSet this attribute to its default value.
inheritIf specified, the associated element uses its parent element text-decoration-The value of the style attribute.

Browser Compatibility

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

  • Firefox6+ -moz-,36+

  • Google Chrome×

  • Internet Explorer ×

  • Apple Safari ×

  • Opera ×

Warning:text-decoration-Warning: 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-line,text-decoration-color.