Remarks

If the value none is placed at the end of the values, all values are cleared.

If the object has no text (for example, the img object in HTML) or is an empty object (for example, "<em></em>"), this property has no effect.

If you set the IHTMLCSSStyleDeclaration::textDecoration attribute to none on the body object, the a objects are still underlined. To remove the underline from the a objects, either set the style inline or use a as a selector in the global style sheet.

Specifying the IHTMLCSSStyleDeclaration::textDecoration property for block elements affects all inline children. If it is specified for, or affects, an inline element, it affects all boxes generated by the element.

The overline and blink possible values are available as of Microsoft Internet Explorer 4.0. Although blink is exposed, it is not rendered.

In Windows Internet Explorer 8 and later, when the IHTMLCSSStyleDeclaration::textDecoration property is set to overline and/or underline, the line will remain at the same vertical level and the same thickness across all child elements of the parent element on which the text decoration has been set. (This does not apply to the line-through value.) In Windows Internet Explorer 7 and earlier, the text decoration adjusts to correspond to the size and thickness of each child element.

Examples

The following examples use the IHTMLCSSStyleDeclaration::textDecoration attribute and the IHTMLCSSStyleDeclaration::textDecoration property to decorate text within the object.

This example uses an inline style sheet to draw a line through the text within the object.

This example demonstrates that, though IHTMLCSSStyleDeclaration::textDecoration is not inheritable, its child elements
are formatted with the same decoration (for instance, an underline) as their
parent. Even if descendant elements have different color values, the color of the decoration will remain the same as that of the parent element.