Set the text decoration for a <p> element:
The textDecoration property sets or returns one ore more decorations for a text.
Tip: To specify more than one decoration type for an element, specify a space separated list of decoration types.
The textDecoration property is supported in all major browsers.
Return the textDecoration property:
Set the textDecoration property:
Value | Description |
---|---|
none | Defines a normal text. This is default |
underline | Defines a line under the text |
overline | Defines a line over the text |
line-through | Defines a line 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 decoration added to the text |
CSS Version | CSS1 |
Return the text decoration of a <p> element:
CSS tutorial: CSS Text
CSS reference: text-decoration property