English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

CSS Reference Manual

CSS @rules (RULES)

Comprehensive List of CSS Properties

CSS text-Usage and examples of the decoration property

text-The decoration CSS property specifies the decoration to be applied to the text content of the element (such as underline, strikethrough, etc.).

The following table provides usage instructions and version history of this property, as well as the syntax of using this property in JavaScript scripts.

Default value:None
Applicable to:All elements
Inheritance:None
Animatable:Yes, because some properties of shorthand can be animated.Please refer to Animation Attribute.
Version:CSS 1,2,3
JavaScript Syntax:object.style.textDecoration="line-through"

text-Syntax of decoration usage

The syntax of this attribute is as follows:

text-decoration: none | [ underline | overline | line-inherit

through | blink ] one or more values | initial |-The following example demonstrates how to use text

  Example
   text-a {
  decoration: overline;
  decoration: none;1 h
   text-{
  decoration: overline;
}/Test see‹

Attribute Value

The following table describes the values of this attribute.Value
Descriptionnone
Do not use text decoration.underline
Each line of text has an underline.overline
Define a line on the text.-linethrough
A line is in the middle of each line of text.blink
Make the text blink (toggle between visible and invisible).inherit-If specified, the associated element uses its parent element text

Values of decoration attribute.

text-Browser Compatibility

  • Browser compatibility of decoration attribute, the numbers in the following table represent the minimum version number of the browser that supports this attribute; all mainstream browsers support this attribute. 1+

  • Firefox1+

  • Google Chrome 3+

  • Internet Explorer 1+

  • Apple Safari 3Opera5+

.Warning:Animation, it is best to avoid using this value.

For further reading

Please refer to the following tutorial:CSS Text,CSS Border,CSS3Animation.

Text-related Attributes:letter-spacing,text-align,text-indent,text-overflow,text-shadow,text-transform,white-space,word-spacing.