From 33058f2b292b3a581333bdfb21b8f671898c5060 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:40:17 -0500 Subject: initial commit --- .../zh-cn/web/css/text-decoration-style/index.html | 120 +++++++++++++++++++++ 1 file changed, 120 insertions(+) create mode 100644 files/zh-cn/web/css/text-decoration-style/index.html (limited to 'files/zh-cn/web/css/text-decoration-style') diff --git a/files/zh-cn/web/css/text-decoration-style/index.html b/files/zh-cn/web/css/text-decoration-style/index.html new file mode 100644 index 0000000000..33d3cce79b --- /dev/null +++ b/files/zh-cn/web/css/text-decoration-style/index.html @@ -0,0 +1,120 @@ +--- +title: text-decoration-style +slug: Web/CSS/text-decoration-style +tags: + - CSS + - CSS Property + - CSS Text Decoration + - Layout + - Reference +translation_of: Web/CSS/text-decoration-style +--- +
{{CSSRef}}
+ +

CSS 属性 text-decoration-style 用于设置由 {{ cssxref("text-decoration-line") }} 设定的线的样式。线的样式会应用到所有被 text-decoration-line 设定的线,不能为其中的每条线设置不同的样式。当要设置多个线修饰属性时,用 {{cssxref("text-decoration")}} 简写属性会比分别写多个属性更方便。

+ +
{{EmbedInteractiveExample("pages/css/text-decoration-style.html")}}
+ + + +

如果设定的修饰效果具有特定的语义,例如删除线的意味着某些文本被删除了,开发者最好使用有语义的 HTML 标签来表达,比如 {{ HTMLElement("del") }} 或 {{ HTMLElement("s") }} 标签,因为浏览器有时可能会屏蔽某些样式,但语义化的标签则不会出现这样的问题。

+ +

当一次使用多个 line-decoration 属性时,使用 {{cssxref("text-decoration")}} 简写属性会更方便。

+ +

语法

+ +
/* Keyword values */
+text-decoration-style: solid;
+text-decoration-style: double;
+text-decoration-style: dotted;
+text-decoration-style: dashed;
+text-decoration-style: wavy;
+
+/* Global values */
+text-decoration-style: inherit;
+text-decoration-style: initial;
+text-decoration-style: unset;
+
+ +

+ +
+
solid
+
画一条实线。
+
double
+
画一条双实线。
+
dotted
+
画一条点划线。
+
dashed
+
画一条虚线。
+
wavy
+
画一条波浪线。
+
-moz-none{{ non-standard_inline }}
+
不画线。亦可用 {{ cssxref("text-decoration-line") }}: none 替代。
+
+ +

格式化语法

+ +
{{csssyntax}}
+ +

示例

+ +
+ + +
.wavy {
+  text-decoration-line: underline;
+  text-decoration-style: wavy;
+  text-decoration-color: red;
+}
+
+ +
<p class="wavy">This text has a wavy red line beneath it.</p>
+
+ +

{{ EmbedLiveSample('Examples', '', '', '') }}

+
+ +

规范

+ + + + + + + + + + + + + + + + +
规范状态备注
{{ SpecName('CSS3 Text Decoration', '#text-decoration-style', 'text-decoration-style') }}{{ Spec2('CSS3 Text Decoration') }}初次定义。{{cssxref("text-decoration")}} 属性同时变成了定义多个相关属性的简写形式。
+ +

浏览器兼容性

+ +

 

+ + + +

{{Compat("css.properties.text-decoration-style")}}

+ +

 

+ +

另请参阅

+ + + +

 

-- cgit v1.2.3-54-g00ecf