Style textDecorationLine 属性
定义和用法
textDecorationLine 属性设置或返回文本修饰要使用的线条类型。
注释: 您也可以使用 textDecoration 属性设置 textDecorationLine。textDecoration 属性是 textDecorationLine、textDecorationStyle 和 textDecorationColor 属性的速记属性。
注释: 您也可以同时使用多个值,比如 underline 和 overline,来在文本的上方和下方都显示线条。
浏览器支持
| 属性 | |||||
|---|---|---|---|---|---|
| textDecorationLine | 57.0 | 79.0 | 36.0 6.0 Moz | 7.0 Webkit | 44.0 | 
语法
返回 textDecorationLine 属性:
 object.style.textDecorationLine 
设置 textDecorationLine 属性:
 object.style.textDecorationLine = "none|underline|overline|line-through|initial|inherit"
属性值
| 值 | 描述 | 
|---|---|
| none | 默认值。规定文本修饰没有线条。 | 
| underline | 规定文本的下方将显示一条线。 | 
| overline | 规定文本的上方将显示一条线。 | 
| line-through | 规定文本的中间将显示一条线。 | 
| initial | 设置该属性为它的默认值。请参阅 initial | 
| inherit | 从父元素继承该属性。请参阅 inherit | 
技术细节
| 默认值: | none | 
|---|---|
| 返回值: | 字符串,表示元素的 text-decoration-line 属性。 | 
| CSS 版本 | CSS3 | 
相关页面
CSS 参考手册: text-decoration-line 属性
❮ Style 对象
