The text-decoration property

The text-decoration property adds various effects to a text: underline, line-through, overline.

Syntax

cssselector {
  text-decoration: underline | line-through | overline | none;
}

Values

Value Description
underline Makes underlined text.
line-through Makes line-through text.
overline Makes a line above a text.
none Undoes underlining of the underlined element. Most often used for links as they are underlined by default.

Default value: none. For links the default value is: underline.

Example . The underline value

html<div id="elem">
  Lorem ipsum dolor sit amet.
</div>
css#elem {
  text-decoration: underline;
}

Результат:

Example . The line-through value

html<div id="elem">
  Lorem ipsum dolor sit amet.
</div>
css#elem {
  text-decoration: line-through;
}

Результат:

Example . The overline value

html<div id="elem">
  Lorem ipsum dolor sit amet.
</div>
css#elem {
  text-decoration: overline;
}

Результат:

See also