CSS text-decoration-line Property


Example

Display <p> elements with a line on top:

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

Try it yourself »

Definition and Usage

The text-decoration-line property specifies what type of line, if any, the decoration will have.

Note: You can also set the text-decoration-line using the text-decoration property, which is a short-hand property for the text-decoration-line, text-decoration-style, and the text-decoration-color properties.

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 Not supported Not supported 6.0 -moz- Not supported Not supported

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



SHARE THIS PAGE

COLOR PICKER

colorpicker





Search w3schools.com:

Translate w3schools.com: