Display paragraphs with a line on top:
The textDecorationLine property sets or returns what type of line, if any, the decoration will have.
Note: You can also set the textDecorationLine using the textDecoration property, which is a short-hand property for the textDecorationLine, textDecorationStyle, and the textDecorationColor properties.
Note: You can also combine more than one value, like underline and overline to display lines both under and over the text.
The textDecorationLine property is not supported in any of the major browsers.
Firefox supports an alternative, the MozTextDecorationLine property.
Return the textDecorationLine property:
Set the textDecorationLine property:
Value | Description |
---|---|
none | Default value. Specifies no line for the text-decoration |
underline | Specifies that a line will be displayed under the text |
overline | Specifies that a line will be displayed over the text |
line-through | Specifies that a line will be displayed through the text |
initial | Sets this property to its default value. Read about initial |
inherit | Inherits this property from its parent element. Read about inherit |
Default Value: | none |
---|---|
Return Value: | A String, representing the text-decoration-line property of an element |
CSS Version | CSS3 |
CSS reference: text-decoration-line property