返回到:CSS 文本格式 | CSS教程
定义和用法
text-decoration-style 属性规定线条如何显示。
| 默认值: | solid |
|---|---|
| 继承: | 否 |
| 可动画化: | 否。 |
| 版本: | CSS3 |
| JavaScript 语法: | object.style.textDecorationStyle=”wavy” |
CSS 语法
text-decoration-style: solid|double|dotted|dashed|wavy|initial|inherit;浏览器支持
表格中的数字表示支持该属性的第一个浏览器版本号。
| 属性 | 谷歌 | IE | 火狐 | 苹果 | opera |
|---|---|---|---|---|---|
| text-decoration-style | 57.0 | 79.0 | 36.0 6.0 -moz- | 12.1 | 44.0 |
属性值
| 值 | 描述 |
|---|---|
| solid | 默认值。线条将显示为单线。 |
| double | 线条将显示为双线。 |
| dotted | 线条将显示为点状线。 |
| dashed | 线条将显示为虚线。 |
| wavy | 线条将显示为波浪线。 |
| initial | 设置该属性为它的默认值。 |
| inherit | 从父元素继承该属性。 |
实例
显示不同类型的下划线:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Web176教程(web176.com)</title>
<style>
div.a {
text-decoration-line: underline;
text-decoration-style: solid;
}
div.b {
text-decoration-line: underline;
text-decoration-style: wavy;
}
div.c {
text-decoration-line: underline;
text-decoration-style: double;
}
div.d {
text-decoration-line: overline underline;
text-decoration-style: wavy;
}
</style>
</head>
<body>
<h1>text-decoration-style 属性</h1>
<div class="a">这里使用了下划线。</div>
<br>
<div class="b">这里使用了波浪线。</div>
<br>
<div class="c">这里使用了两个下划线。</div>
<br>
<div class="d">这是一些带有波浪上划线和下划线的文本。</div>
<p><b>注意:</b>Edge 79 以前的版本不支持 text-decoration-line 属性。</p>
</body>
</html>作者:terry,如若转载,请注明出处:https://www.web176.com/cssprop/5728.html
支付宝
微信