Style textDecorationLineProperty
Examples
Display a line at the top of the paragraph:
Try it Yourself »
Definition and Usage
The textDecorationLine property sets or returns the type of line to be used for text decoration.
Note:You can also use the textDecoration property to set textDecorationLine. The textDecoration property is a shorthand property for the textDecorationLine, textDecorationStyle, and textDecorationColor properties.
Note:You can also use multiple values at the same time, such as underlineandoverline, to display lines both above and below the text.
Browser Support
![]()
Almost all mainstream browsers do not support the textDecorationLine property.
Firefox supports an alternative property that can replace this one, namely the MozTextDecorationLine property.
Syntax
Return the textDecorationLine property:
Set the textDecorationLine property:
Property Values
| Value | Description |
|---|---|
| none | Default value. Specifies that the text decoration has no line. |
| underline | Specifies that a line will be displayed below the text. |
| overline | Specifies that a line will be displayed above the text. |
| line-through | Specifies that a line will be displayed in the middle of the text. |
| initial | Sets this property to its default value. Seeinitial。 |
| inherit | Inherits this property from its parent element. Seeinherit。 |
Technical Details
| Default Value: | none |
|---|---|
| Return Value: | A string, representing the element's text-decoration-line property. |
| CSS Version | CSS3 |
Related Articles
CSS Reference Manual:text-decoration-line property
Other Extensions
Style Object