CSS text-decoration Property

❮ Previous Reference Next ❯


.example1 {
  text-decoration: overline;

.example2 {
  text-decoration: underline;

.example3 {
  text-decoration: line-through;

.example4 {
  text-decoration: underline overline;

Hello World!


The text-decoration property shorthand CSS property sets the appearance of decorative lines on text.

It is a shorthand for text-decoration-line, text-decoration-color, text-decoration-style, and the newer text-decoration-thickness property.

Default value:none currentColor solid auto
Version:CSS1, renewed in CSS3
JavaScript syntax:
object.style.textDecoration="text-decoration-line text-decoration-color text-decoration-style text-decoration-thickness|initial|inherit|revert|revert-layer|unset";

Standard Syntax

text-decoration: text-decoration-line text-decoration-color text-decoration-style text-decoration-thickness|initial|inherit|revert|revert-layer|unset;

Browser Support

The numbers in the table specify the first browser version that fully supports the property.


Property Values

The following table describes the values of this property.

Value Description
text-decoration-line Sets the kind of decoration used, such as underline or line-through.
text-decoration-color Sets the color of the decoration.
text-decoration-style Sets the style of the line used for the decoration, such as solid, wavy, or dashed.
text-decoration-thickness Sets the thickness of the line used for the decoration.
initial Sets this property to its default value.
inherit If specified, the associated element takes the computed value of its parent element animation-delay property.
revert Reverts the cascaded value of the property from its current value to the value the property
revert-layer Rollback styles to the ones specified in previous cascade layers.
unset Resets a property to its inherited value if the property naturally inherits from its parent, and to its initial value if not.

Default CSS Property Values

selectors {
  text-decoration: none currentColor solid auto;
❮ Previous Reference Next ❯