CSS text-decoration-lineProperty
Example
Display a line at the top of the paragraph:
p
{
text-decoration-line: overline;
-moz-text-decoration-line: overline; /* Firefox-specific code */
}
{
text-decoration-line: overline;
-moz-text-decoration-line: overline; /* Firefox-specific code */
}
Try it Yourself »
Browser Support
![]()
Almost all mainstream browsers do not support the text-decoration-line property.
Firefox supports an alternative property to this one, namely the -moz-text-decoration-line property.
Definition and Usage
The text-decoration-line property specifies the type of line to be used for text decoration.
Note:youYou can also use text-decoration PropertySettings text-decoration-line。text-decoration PropertyYes text-decoration-line、text-decoration-style and text-decoration-color Propertyof速记Property.
Note:You can also use multiple values at the same time, such as underlineandoverline, to display lines both above and below the text.
| Default value: | none |
|---|---|
| Inherited: | no |
| Animatable: | No. SeeAnimatable。 |
| version: | CSS3 |
| JavaScript Syntax: | object.style.textDecorationLine="overline" Try it Yourself |
CSS Syntax
text-decoration-line: none|underline|overline|line-through|initial|inherit;
Property value
| Value | Description | Testing |
|---|---|---|
| none | The default value. Specifies that text decoration has no line. | Test » |
| underline | Specifies that a line will be displayed below the text. | Test » |
| overline | Specifies that a line will be displayed above the text. | Test » |
| line-through | Specifies that a line will be displayed through the middle of the text. | Test » |
| initial | Sets this property to its default value. Please refer toinitial。 | Test » |
| inherit | Inherit this property from the parent element. Seeinherit。 |
other extensions