CSS text-decoration-style 属性 | CSS 文本格式 | CSS教程

返回到: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-style57.079.036.0
6.0 -moz-
12.144.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

(0)
打赏 支付宝 支付宝 微信 微信
terryterry
上一篇 2022年4月21日 下午5:40
下一篇 2022年4月22日 下午1:58

相关推荐

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注