aboutsummaryrefslogtreecommitdiff
path: root/files/zh-cn/web/css/text-decoration-style
diff options
context:
space:
mode:
authorPeter Bengtsson <mail@peterbe.com>2020-12-08 14:40:17 -0500
committerPeter Bengtsson <mail@peterbe.com>2020-12-08 14:40:17 -0500
commit33058f2b292b3a581333bdfb21b8f671898c5060 (patch)
tree51c3e392513ec574331b2d3f85c394445ea803c6 /files/zh-cn/web/css/text-decoration-style
parent8b66d724f7caf0157093fb09cfec8fbd0c6ad50a (diff)
downloadtranslated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.gz
translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.bz2
translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.zip
initial commit
Diffstat (limited to 'files/zh-cn/web/css/text-decoration-style')
-rw-r--r--files/zh-cn/web/css/text-decoration-style/index.html120
1 files changed, 120 insertions, 0 deletions
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
+---
+<div>{{CSSRef}}</div>
+
+<p><a href="/en-US/docs/CSS">CSS</a> 属性 <strong><code>text-decoration-style</code></strong> 用于设置由 {{ cssxref("text-decoration-line") }} 设定的线的样式。线的样式会应用到所有被 <code>text-decoration-line</code> 设定的线,不能为其中的每条线设置不同的样式。当要设置多个线修饰属性时,用 {{cssxref("text-decoration")}} 简写属性会比分别写多个属性更方便。</p>
+
+<div>{{EmbedInteractiveExample("pages/css/text-decoration-style.html")}}</div>
+
+
+
+<p>如果设定的修饰效果具有特定的语义,例如删除线的意味着某些文本被删除了,开发者最好使用有语义的 HTML 标签来表达,比如 {{ HTMLElement("del") }} 或 {{ HTMLElement("s") }} 标签,因为浏览器有时可能会屏蔽某些样式,但语义化的标签则不会出现这样的问题。</p>
+
+<p>当一次使用多个 line-decoration 属性时,使用 {{cssxref("text-decoration")}} 简写属性会更方便。</p>
+
+<h2 id="语法">语法</h2>
+
+<pre class="brush: css no-line-numbers">/* 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;
+</pre>
+
+<h3 id="值">值</h3>
+
+<dl>
+ <dt>solid</dt>
+ <dd>画一条实线。</dd>
+ <dt>double</dt>
+ <dd>画一条双实线。</dd>
+ <dt>dotted</dt>
+ <dd>画一条点划线。</dd>
+ <dt>dashed</dt>
+ <dd>画一条虚线。</dd>
+ <dt>wavy</dt>
+ <dd>画一条波浪线。</dd>
+ <dt>-moz-none{{ non-standard_inline }}</dt>
+ <dd>不画线。亦可用 {{ cssxref("text-decoration-line") }}<code>: none</code> 替代。</dd>
+</dl>
+
+<h3 id="格式化语法">格式化语法</h3>
+
+<pre class="syntaxbox">{{csssyntax}}</pre>
+
+<h2 id="示例">示例</h2>
+
+<div id="Examples">
+<pre class="brush: css" style="display: none;">.example {
+ -moz-text-decoration-line: underline;
+ -moz-text-decoration-style: wavy;
+ -moz-text-decoration-color: red;
+ -webkit-text-decoration-line: underline;
+ -webkit-text-decoration-style: wavy;
+ -webkit-text-decoration-color: red;
+}</pre>
+
+<pre class="brush: css">.wavy {
+ text-decoration-line: underline;
+ text-decoration-style: wavy;
+ text-decoration-color: red;
+}
+</pre>
+
+<pre class="brush: html">&lt;p class="wavy"&gt;This text has a wavy red line beneath it.&lt;/p&gt;
+</pre>
+
+<p>{{ EmbedLiveSample('Examples', '', '', '') }}</p>
+</div>
+
+<h2 id="规范">规范</h2>
+
+<table class="standard-table">
+ <thead>
+ <tr>
+ <th scope="col">规范</th>
+ <th scope="col">状态</th>
+ <th scope="col">备注</th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr>
+ <td>{{ SpecName('CSS3 Text Decoration', '#text-decoration-style', 'text-decoration-style') }}</td>
+ <td>{{ Spec2('CSS3 Text Decoration') }}</td>
+ <td>初次定义。{{cssxref("text-decoration")}} 属性同时变成了定义多个相关属性的简写形式。</td>
+ </tr>
+ </tbody>
+</table>
+
+<h2 id="浏览器兼容性">浏览器兼容性</h2>
+
+<p> </p>
+
+
+
+<p>{{Compat("css.properties.text-decoration-style")}}</p>
+
+<p> </p>
+
+<h2 id="另请参阅">另请参阅</h2>
+
+<ul>
+ <li>当要设置多个线修饰属性时,用 {{cssxref("text-decoration")}} 简写属性会比分别写多个属性更方便</li>
+</ul>
+
+<p> </p>