CSS text-underline-offset 属性
示例
设置下划线文本装饰的偏移距离
div.a {
text-decoration: underline;
}
div.b {
text-decoration: underline;
text-underline-offset: 10px;
}
div.c {
text-decoration: underline wavy blue;
}
div.d {
text-decoration: underline wavy blue;
text-underline-offset: 10px;
}
自己动手试一试 »
定义和用法
text-underline-offset
属性指定下划线文本装饰的偏移距离。
浏览器支持
表中的数字指定了完全支持该属性的第一个浏览器版本。
属性 | |||||
---|---|---|---|---|---|
text-underline-offset | 87.0 | 87.0 | 70.0 | 12.1 | 73.0 |
CSS 语法
text-underline-offset: auto|length|percentage|initial|inherit;
属性值
值 | 描述 | 试一试 |
---|---|---|
auto | 默认值。浏览器会为下划线设置合适的偏移量 | 演示 ❯ |
length | 将偏移量指定为长度值 | 演示 ❯ |
百分比 | 将偏移量指定为百分比值 | 演示 ❯ |
initial | 将此属性设置为其默认值。阅读关于initial | |
inherit | 从其父元素继承此属性。阅读关于inherit |
相关页面
CSS 教程:CSS 文本装饰
HTML DOM 参考:textDecoration 属性