CSS text-decoration-line Property
Example
Set different types of text-decoration lines:
div.a
{
text-decoration-line: overline;
}
div.b
{
text-decoration-line: underline;
}
div.c
{
text-decoration-line: line-through;
}
div.d
{
text-decoration-line: overline underline;
}
Try it Yourself »
Definition and Usage
The text-decoration-line
property sets the kind of text decoration to use
(like underline, overline, line-through).
Tip: Also look at the text-decoration property, which is a short-hand property for text-decoration-line, text-decoration-style, and text-decoration-color.
Note: You can also combine more than one value, like underline and overline to display lines both under and over the text.
Default value: | none |
---|---|
Inherited: | no |
Animatable: | no. Read about animatable |
Version: | CSS3 |
JavaScript syntax: | object.style.textDecorationLine="overline" Try it |
Browser Support
The numbers in the table specify the first browser version that fully supports the property.
Numbers followed by -moz- specify the first version that worked with a prefix.
Property | |||||
---|---|---|---|---|---|
text-decoration-line | 57.0 | Not supported | 36.0 6.0 -moz- |
7.1 -webkit- | 44.0 |
CSS Syntax
text-decoration-line: none|underline|overline|line-through|initial|inherit;
Property Values
Value | Description | Play it |
---|---|---|
none | Default value. Specifies no line for the text-decoration | Play it » |
underline | Specifies that a line will be displayed under the text | Play it » |
overline | Specifies that a line will be displayed over the text | Play it » |
line-through | Specifies that a line will be displayed through the text | Play it » |
initial | Sets this property to its default value. Read about initial | Play it » |
inherit | Inherits this property from its parent element. Read about inherit |
Related Pages
CSS tutorial: CSS Text
HTML DOM reference: textDecorationLine property