CSS text-decoration-style 属性
示例
设置不同类型的文本装饰样式
div.a {
text-decoration-line: underline;
text-decoration-style: solid;
}
div.b {
text-decoration-line: underline;
text-decoration-style: wavy;
}
div.c {
text-decoration-line: underline;
text-decoration-style: double;
}
div.d {
text-decoration-line: overline underline;
text-decoration-style: wavy;
}
自己动手试一试 »
定义和用法
text-decoration-style
属性设置文本装饰的样式(如实线、波浪线、点状线、虚线、双线)。
提示:另请参阅 text-decoration 属性,它是 text-decoration-line、text-decoration-style、text-decoration-color 和 text-decoration-thickness 的简写属性。
浏览器支持
表中的数字指定了完全支持该属性的第一个浏览器版本。
属性 | |||||
---|---|---|---|---|---|
text-decoration-style | 57 | 79 | 36 | 12.1 | 44 |
CSS 语法
text-decoration-style: solid|double|dotted|dashed|wavy|initial|inherit;
属性值
值 | 描述 | 试一试 |
---|---|---|
solid | 默认值。线条将显示为单线 | 演示 ❯ |
double | 线条将显示为双线 | 演示 ❯ |
dotted | 线条将显示为点状线 | 演示 ❯ |
dashed | 线条将显示为虚线 | 演示 ❯ |
wavy | 线条将显示为波浪线 | 演示 ❯ |
initial | 将此属性设置为其默认值。阅读关于initial | |
inherit | 从其父元素继承此属性。阅读关于inherit |
相关页面
CSS 教程:CSS 文本装饰
HTML DOM 参考:textDecorationStyle 属性