English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
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" |
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 |
---|---|
Description | none |
Do not use text decoration. | underline |
Each line of text has an underline. | overline |
Define a line on the text.-line | through |
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 |
text-Browser Compatibility
|
.Warning:Animation, it is best to avoid using this value.
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.