HTML Dog
Skip to navigation

CSS Property: text-decoration

Underlined, overlined, and struck-through text.

A shorthand property that combines text-decoration-line, text-decoration-style, and text-decoration-color.

Possible Values

A space-separated list, containing values representing text-decoration-line, text-decoration-style, and text-decoration-color.

Value Description Example
[line]
(equivalent of text-decoration-line value – can be multiple values)
  • Line is set explicitly.
  • Style defaults to solid.
  • Color defaults to the color property of the text.
underline
[line] [style]
(equivalent of text-decoration-line value(s) and text-decoration-style value)
  • Line is set explicitly.
  • Style is set explicitly.
  • Color defaults to the color property of the text.
overline dotted
[line] [color]
(equivalent of text-decoration-line value(s) and text-decoration-color value)
  • Line is set explicitly.
  • Style defaults to solid.
  • Color is set explicitly.
line-through red
[line] [style] [color]
(equivalent of text-decoration-line value(s), and text-decoration-style value, and text-decoration-color value)
  • Line is set explicitly.
  • Style is set explicitly.
  • Color is set explicitly.
underline double #06c
inherit
initial
unset

Example


.oldfangled a:hover { text-decoration: none }

.newfangled a:hover { text-decoration: underline overline line-through wavy #f99 } 

Browser support

Can I Use advanced text-decoration? Data on support for the advanced text-decoration feature across the major browsers from caniuse.com.