This page is Ready to Use

Notice: The WebPlatform project, supported by various stewards between 2012 and 2015, has been discontinued. This site is now available on github.

text-decoration-line

Summary

Sets what kind of line decorations are added to an element, such as underlines, overlines, etc.

Overview table

Initial value
none
Applies to
All elements
Inherited
No
Media
visual
Computed value
as specified
Animatable
No
CSS Object Model Property
textDecorationLine

Syntax

  • text-decoration-line: blink
  • text-decoration-line: line-through
  • text-decoration-line: none
  • text-decoration-line: overline
  • text-decoration-line: underline

Values

none
Produces no text decoration.
underline
Each line of text is underlined.
overline
Each line of text has a line above it.
line-through
Each line of text has a line through the middle.
blink
The text alternates between visible and invisible.

Examples

p:nth-child(1) { text-decoration-line: none; }
p:nth-child(2) { text-decoration-line: underline; }
p:nth-child(3) { text-decoration-line: overline; }
p:nth-child(4) { text-decoration-line: line-through; }
p:nth-child(5) { text-decoration-line: blink; }

View live example

Notes

The text-decoration-line property is the equivalent of the text-decoration property before it was converted to a shorthand property in CSS Text Decoration Level 3.

Related specifications

CSS Text-decoration Level 3
Working Draft

Attributions

  • Mozilla Developer Network cc-by-sa-small-wpd.svg: Article