text-decoration-style

语法

  • text-decoration-style:solid | double | dotted | dashed | wavy
  • 默认值:solid
  • 适用于:所有元素
  • 继承性:无
  • 动画性:否
  • 计算值:指定的值

取值

  • solid:实线
  • double:双线
  • dotted:点状线条
  • dashed:虚线
  • wavy:波浪线

说明

检索或设置对象中的文本装饰线条的形状。

  • 对应的脚本特性为textDecorationStyle。

兼容性

Values IE Firefox Chrome Safari Opera iOS Safari Android Browser Android Chrome
Basic Support 6.0-11.0 2.0-5.0 4.0-45.0 6.0-7.0 15.0-29.0 6.0-7.1 2.1-4.4.4 18.0-42.0
6.0-35.0-moz- 7.1-8.0-webkit-#1 8.0-8.3-webkit-#1
36.0+
  • 支持dotted | dashed属性值,但效果都表现为实线。

示例


<!DOCTYPE html>
<html lang="zh-cmn-Hans">
<head>
<style>
.test li{
    margin-top:10px;
    -webkit-text-decoration-line:underline;
    -moz-text-decoration-line:underline;
    text-decoration-line:underline;
}
.test li:nth-child(1){
    -webkit-text-decoration-style:solid;
    -moz-text-decoration-style:solid;
    text-decoration-style:solid;
}
.test li:nth-child(2){
    -webkit-text-decoration-style:double;
    -moz-text-decoration-style:double;
    text-decoration-style:double;
}
.test li:nth-child(3){
    -webkit-text-decoration-style:dotted;
    -moz-text-decoration-style:dotted;
    text-decoration-style:dotted;
}
.test li:nth-child(4){
    -webkit-text-decoration-style:dashed;
    -moz-text-decoration-style:dashed;
    text-decoration-style:dashed;
}
.test li:nth-child(5){
    -webkit-text-decoration-style:wavy;
    -moz-text-decoration-style:wavy;
    text-decoration-style:wavy;
}
</style>
</head>
<body>
<ul class="test">
    <li>文本装饰实线</li>
    <li>文本装饰双线</li>
    <li>文本装饰密虚线</li>
    <li>文本装饰疏虚线</li>
    <li>文本装饰波浪线</li>
</ul>
</body>
</html>