©
本文档使用
php中文网手册 发布
text-decoration:<' text-decoration-line '> || <' text-decoration-style '> || <' text-decoration-color '>
默认值:看每个独立属性
适用于:所有元素
继承性:无
动画性:看每个独立属性
计算值:看每个独立属性
相关属性:<' text-decoration-skip '> || <' text-underline-position '>
<' text-decoration-line '>:指定文本装饰的种类。相当于CSS2.1的 <' text-decoration '> 属性,可取值:none | underline | overline | line-through | blink
<' text-decoration-style '>:指定文本装饰的样式。
<' text-decoration-color '>:指定文本装饰的颜色。
所有浏览器均支持CSS2.1中的 <' text-decoration '> 属性,在CSS3中,该属性定义被移植到其新的分解属性 <' text-decoration-line '> 上;
对应的脚本特性为textDecoration。
| Values | IE | Firefox | Chrome | Safari | Opera | iOS Safari | Android Browser | Android Chrome |
|---|---|---|---|---|---|---|---|---|
| Basic Support | 6.0+ | 2.0+ | 4.0+ | 6.0+ | 15.0+ | 6.0+ | 2.1+ | 18.0+ |
| CSS3复合属性 | 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+ |
支持 <' text-decoration-style '> 写入 <' text-decoration '> 缩写方式,但其dotted | dashed属性值会表现为实线。
<!DOCTYPE html>
<html lang="zh-cmn-Hans">
<head>
<meta charset="utf-8" />
<title>text-decoration_CSS参考手册_web前端开发参考手册系列</title>
<meta name="author" content="Joy Du(飘零雾雨), dooyoe@gmail.com, www.doyoe.com" />
<style>
.test li{margin-top:10px;}
.test .none{text-decoration:none;}
.test .underline{text-decoration:underline;}
.test .overline{text-decoration:overline;}
.test .line-through{text-decoration:line-through;}
.test .blink{text-decoration:blink;}
.test .text-decoration-css3{
-webkit-text-decoration:#f00 wavy underline;
-moz-text-decoration:#f00 solid underline;
text-decoration:#f00 solid underline;
}
</style>
</head>
<body>
<ul class="test">
<li class="none">无装饰文字</li>
<li class="underline">带下划线文字</li>
<li class="overline">带上划线文字</li>
<li class="line-through">带贯穿线文字</li>
<li class="blink">带闪烁文字</li>
<li class="text-decoration-css3">如果你的浏览器支持text-decoration在CSS3下的改变,将会看到本行文字有一条红色的下划实线</li>
</ul>
</body>
</html>
点击 "运行实例" 按钮查看在线实例