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

manuel de référence CSS

règle CSS @ (RULES)

大全 des attributs CSS

CSS3 text-decoration-Méthode d'utilisation et exemple de l'attribut line

Le texte-decoration-L'attribut lineCSS spécifie quel type de motif est ajouté à l'élément. Cet attribut peut accepter une ou plusieurs valeurs séparées par des espaces.

下表为此属性的用法说明和版本历史记录,以及该属性在javascript脚本中的使用语法。

默认值:none
适用于:
所有元素。它也适用于::first-letter和::first-line。
继承:没有
可动画制作:否。请参见 属性动画
版本: CSS3的新功能
语法 JavaScript:object.style.textDecorationLine="underline"

text-decoration-使用语法 line 的

该属性的语法如下:

text-decoration-line: none | [ underline | overline | line-through | blink ] one or more values | initial | inherit

下面的示例演示了如何使用text-decoration-属性 line。

p {
    -moz-text-decoration-line: underline; /* Firefox */
    text-decoration-line: underline; 
}
p.multiple {
    -moz-text-decoration-line: underline overline; /* Firefox */
    text-decoration-line: underline overline; 
}
测试看看‹/›

属性值

下表描述了此属性的值。

描述
none文字没有修饰。这是默认值。
underline每行文本都带有下划线。
overline每行文字上方都有一条线。
line-through每一行文字中间都有一条线。
blink使文本闪烁(在可见和不可见之间切换)。不推荐使用此值,而推荐使用动画
initial将此属性设置为其默认值。
inherit如果指定,则关联元素采用其父元素text-decoration-值属性 line

兼容性浏览器

text-decoration-大多数浏览器均不支持该属性。

  • Firefox 6+ -moz-,36+

  • Google Chrome×

  • Internet Explorer ×

  • Apple Safari ×

  • Opera ×

警告:text-decoration-警告:大多数浏览器当前不支持该属性。您最好避免使用此属性。

进一步阅读

请参考以下教程:文本 CSS边框 CSS

属性相关:text-decorationtext-decoration-colortext-decoration-style