CSS text-decoration-lineProperty

CSS Reference


Example

Display a line at the top of the paragraph:

p
{
text-decoration-line: overline;
-moz-text-decoration-line: overline; /* Firefox-specific code */
}

Try it Yourself »

Browser Support

Internet Explorer Firefox Opera Google Chrome Safari

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.
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 through the middle of the text.
initial Sets this property to its default value. Please refer toinitial。
inherit Inherit this property from the parent element. Seeinherit。

CSS Reference

other extensions