样式 textDecorationLine 属性
描述
textDecorationLine 属性设置或返回装饰线(如果有)的类型。
注意:您也可以使用 textDecoration 属性来设置 textDecorationLine,它是 textDecorationLine、textDecorationStyle 和 textDecorationColor 属性的简写属性。
注意:您还可以组合多个值,例如 underline 和 overline,以在文本下方和上方显示线条。
浏览器支持
| 属性 | |||||
|---|---|---|---|---|---|
| textDecorationLine | 57.0 | 79.0 | 36.0 | 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 属性