Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

CSS text-decoration-line property

CSS text-decoration-line property

CSS Reference Manual CSS Reference Manual

Example

Display a line at the top of a paragraph:

p

{

text-decoration-line: overline;

-moz-text-decoration-line: overline; /* Code for Firefox */

}

Try it »


Browser support

Internet Explorer Firefox Opera Google Chrome Safari

Almost no major browsers support the text-decoration-line property.

Firefox supports an alternative to this property, 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:** You can also use the text-decoration property to set text-decoration-line. The text-decoration property is a shorthand for the text-decoration-line, text-decoration-style, and text-decoration-color properties.

**Note:** You can also use multiple values at the same time, such as underline and overline, to display lines both above and below the text.

Default value: none
Inherited: No
Animatable: No. See Animatable.
Version: CSS3
JavaScript syntax: object.style.textDecorationLine="overline" Try it

CSS Syntax

text-decoration-line: none|underline|overline|line-through|initial|inherit;

Attribute values

Value Description Testing
none Default. Specifies that the 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. See initial. Test »
inherit Inherits this property from its parent element. See inherit.

CSS Reference Manual CSS Reference Manual