手册
目录
收藏632
分享
阅读1027
更新时间2025-07-16
text-decoration-color 属性规定 text-decoration(下划线、上划线、穿线)的颜色。
CSS 教程:CSS 文本
HTML DOM 参考手册:textDecorationColor 属性
把 text-decoration 的颜色设置为红色:
p {
text-decoration: underline;
text-decoration-color: red;
}
运行实例 »点击 "运行实例" 按钮查看在线实例
text-decoration-color: color|initial|inherit;
| 值 | 描述 |
|---|---|
| color | 规定 text-decoration 的颜色。 |
| initial | 将此属性设置为其默认值。参阅 initial。 |
| inherit | 从其父元素继承此属性。参阅 inherit。 |
| 默认值: | currentColor |
|---|---|
| 继承: | 否 |
| 动画制作: | 支持。请参阅:动画相关属性。 |
| 版本: | CSS3 |
| JavaScript 语法: | object.style.textDecorationColor="red" |
表格中的数字注明了完全支持该属性的首个浏览器版本。
带 -webkit- 或 -moz- 的数字表示使用前缀的首个版本。
| Chrome | IE / Edge | Firefox | Safari | Opera |
|---|---|---|---|---|
| 57.0 | 79.0 | 36.0 6.0 -moz- |
12.1 7.1 -webkit- |
44.0 |
相关
视频
RELATED VIDEOS
科技资讯
1
2
3
4
5
6
7
8
9
精选课程
共5课时
17.2万人学习
共49课时
77万人学习
共29课时
61.7万人学习
共25课时
39.3万人学习
共43课时
70.9万人学习
共25课时
61.6万人学习
共22课时
23万人学习
共28课时
33.9万人学习
共89课时
125万人学习