Skip to content
Tutorials Center
My learning

Topics

CSS Reference ยท Typography

The text-decoration-line property

Reference for the CSS text-decoration-line property: underline, overline and line-through, combining several lines, and how it differs from the shorthand.

The text-decoration-line property chooses which lines are drawn on text: an underline below, an overline above or a line-through across the middle. Without a line, the other decoration properties (style, color, thickness) have no visible effect. You can list more than one line type at once.

CSS
.deleted {
  text-decoration-line: line-through;
}

Try it

Choosing lines

Syntax

CSS
text-decoration-line: none | [ underline || overline || line-through || blink ] | spelling-error | grammar-error;
  • Initial value: none
  • Applies to: all elements; also ::first-letter and ::first-line
  • Inherited: no (but the line is drawn across in-flow inline descendants)
  • Animatable: no
  • Computed value: as specified

Values

Value Description
none No line.
underline A line below the text.
overline A line above the text.
line-through A line through the middle of the text (strikethrough).
blink Blinking text. Deprecated; browsers are not required to support it, and you should not use it.
spelling-error, grammar-error Browser-style error marks. Defined for use by browsers and special cases; support in author CSS is very limited, so check a compatibility table.

Usage notes

  • Combine by listing. underline line-through draws both lines. Order does not matter.
  • Does not draw on its own descendants. A parent's line passes through inline children and cannot be turned off by them.
  • none on <a>. text-decoration-line: none removes the default link underline, but keep another cue for links.
  • Semantic strike-through. Use <del> or <s> in HTML when the meaning matters, and use the property for purely visual strikes.
  • Flashing is an accessibility risk. Do not use blink; it is also ignored by most browsers.
  • Shorthand resets. Writing text-decoration: ... after this property resets it. Order your declarations accordingly.

Browser support

none, underline, overline and line-through are supported in every modern browser. spelling-error and grammar-error are not widely usable; blink is deprecated.