CSS text-decoration-line 属性
实例
设置不同的 text-decoration 线条类型:
div.a { text-decoration-line: overline; } div.b { text-decoration-line: underline; } div.c { text-decoration-line: line-through; } div.d { text-decoration-line: overline underline; }
定义和用法
text-decoration-line 属性设置要使用哪种文本装饰的类型(下划线、上划线、穿线)。
提示:同时请参阅 text-decoration 属性,它是 text-decoration-line、text-decoration-style 以及 text-decoration-color 的简写属性。
注释:您还可以组合多个值,比如 underline 和 overline,在文本上下方同时显示线条。
默认值: | none |
---|---|
继承: | 否 |
动画制作: | 不支持。请参阅:动画相关属性。 |
版本: | CSS3 |
JavaScript 语法: | object.style.textDecorationLine="overline" |
浏览器支持
表格中的数字注明了完全支持该属性的首个浏览器版本。
带 -webkit- 或 -moz- 的数字表示使用前缀的首个版本。
属性 | Chrome | IE | Firefox | Safari | Opera |
---|---|---|---|---|---|
text-decoration-line | 57.0 | 79.0 | 36.0 6.0 -moz- | 7.1 -webkit- | 44.0 |