Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

HTML DOM Style textDecoration Property

Style textDecoration Property

Style Object Reference The Style object


Definition and Usage

The textDecoration property sets or returns one or more text decorations.

**Tip:** To specify more than one type of decoration for an element, specify a space-separated list.

Syntax

Set the textDecoration property:

Object.style.textDecoration="none|underline|overline|line-through|blink|inherit"

Return the textDecoration property:

Object.style.textDecoration

Value Description
none Default. Defines standard text.
underline Defines a line below the text.
overline Defines a line above the text.
line-through Defines a line through the text.
inherit The value of the textDecoration property is inherited from the parent element.

Browser support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support the textDecoration property.

**Note:** IE7 and earlier versions do not support the "inherit" value. IE8 supports "inherit" only if a !DOCTYPE is specified. IE9 supports "inherit".


Example

Example

Decorate the text:

Runoob Tutorial(runoob.com)

This is some text.


Try it »


Style Object Reference The Style object