手册
目录
收藏649
分享
阅读1050
更新时间2025-07-16
text-decoration-thickness 属性规定装饰线的粗细。
CSS 参考手册:text-decoration 属性
CSS 教程:CSS 文字
为
h1 {
  text-decoration: underline;
  text-decoration-thickness: auto;
}
h2 {
  text-decoration: underline;
  text-decoration-thickness: 5px;
}
h3 {
  text-decoration: underline;
  text-decoration-thickness: 50%;
}
/* 使用简写属性 */
h4 {
  text-decoration: underline solid red 50%;
}
运行实例 »点击 "运行实例" 按钮查看在线实例
text-decoration-thickness: auto|from-font|length/percentage|initial|inherit;
| 值 | 描述 | 
|---|---|
| auto | 浏览器选择装饰线的粗细。 | 
| from-font | 如果字体文件包含有关首选粗细的信息,请使用该值。如果没有,则表现为 auto。 | 
| length/percentage | 规定粗细为长度值或百分比值。 | 
| initial | 将此属性设置为其默认值。参阅 initial。 | 
| inherit | 从其父元素继承此属性。参阅 inherit。 | 
| 默认值: | auto | 
|---|---|
| 继承: | 否 | 
| 动画制作: | 不支持。请参阅:动画相关属性。 | 
| 版本: | CSS4 | 
| JavaScript 语法: | object.style.textDecorationThickness="5px" | 
表中的数字注明了首个完全支持该属性的浏览器版本。
| Chrome | IE / Edge | Firefox | Safari | Opera | 
|---|---|---|---|---|
| 89.0 | 89.0 | 70.0 | 12.1 | 75.0 | 
相关
视频
RELATED VIDEOS
科技资讯
1
2
3
4
5
6
7
8
精选课程
							
							共5课时
17.2万人学习
							
							共49课时
77万人学习
							
							共29课时
61.7万人学习
							
							共25课时
39.3万人学习
							
							共43课时
70.9万人学习
							
							共25课时
61.6万人学习
							
							共22课时
23万人学习
							
							共28课时
33.9万人学习
							
							共89课时
125万人学习