CSS text-decoration Property


The text-decoration property allows you to "decorate" the text's content. It is essentially a text decoration with various types of lines. It's a shortcut for text-decoration-line, text-decoration-color, and text-decoration-style.

Text decorations are drawn across child text elements, which means that if the parent element specifies a text-decoration, the child element cannot remove the parent element's decoration.

Syntax

Example

Preview

Property Values

Value Description
text-decoration-line Sets the type of text decoration to be used (like underline, overline, line-through).
text-decoration-color This property specifies the colour of the text decoration.
text-decoration-style Sets the text decoration style (like solid, wavy, dotted, dashed, double).
text-decoration-thickness The thickness of the decoration line is set here.
initial This property is set to its default value.
inherit This property is inherited from its parent element.

Supported Browsers

Property Chrome Firefox Safari Edge / IE Opera
text-decoration 1.0 1.0 1.0 3.0 3.5