diff options
author | Peter Bengtsson <mail@peterbe.com> | 2020-12-08 14:40:17 -0500 |
---|---|---|
committer | Peter Bengtsson <mail@peterbe.com> | 2020-12-08 14:40:17 -0500 |
commit | 33058f2b292b3a581333bdfb21b8f671898c5060 (patch) | |
tree | 51c3e392513ec574331b2d3f85c394445ea803c6 /files/zh-cn/web/css/text-decoration-line | |
parent | 8b66d724f7caf0157093fb09cfec8fbd0c6ad50a (diff) | |
download | translated-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-line')
-rw-r--r-- | files/zh-cn/web/css/text-decoration-line/index.html | 109 |
1 files changed, 109 insertions, 0 deletions
diff --git a/files/zh-cn/web/css/text-decoration-line/index.html b/files/zh-cn/web/css/text-decoration-line/index.html new file mode 100644 index 0000000000..7b8e74abf6 --- /dev/null +++ b/files/zh-cn/web/css/text-decoration-line/index.html @@ -0,0 +1,109 @@ +--- +title: text-decoration-line +slug: Web/CSS/text-decoration-line +tags: + - CSS + - CSS 属性 + - CSS 文本修饰 + - 参考 +translation_of: Web/CSS/text-decoration-line +--- +<div>{{CSSRef}}</div> + +<p><a href="/en-US/docs/CSS">CSS</a> 属性 <strong><code>text-decoration-line</code></strong> 用于设置元素中的文本的修饰类型。当要设置多个线修饰属性时,用 {{cssxref("text-decoration")}} 简写属性会比分别写多个属性更方便。</p> + +<pre class="brush:css no-line-numbers">/* Keyword values */ +text-decoration-line: none; +text-decoration-line: underline; +text-decoration-line: overline; +text-decoration-line: line-through; +text-decoration-line: blink; +text-decoration-line: underline overline; /* Two decoration lines */ +text-decoration-line: overline underline line-through; /* Multiple decoration lines */ + +/* Global values */ +text-decoration-line: inherit; +text-decoration-line: initial; +text-decoration-line: unset; +</pre> + +<p>{{cssinfo}}</p> + +<h2 id="语法">语法</h2> + +<h3 id="值">值</h3> + +<p><code>text-decoration-line</code> 属性可以设置为 <code>none</code>, 或者<strong>一个及多个</strong>用空格分隔的下列值。</p> + +<dl> + <dt><code>none</code></dt> + <dd>表示没有文本修饰效果。</dd> + <dt><code>underline</code></dt> + <dd>在文本的下方有一条修饰线。</dd> + <dt><code>overline</code></dt> + <dd>在文本的上方有一条修饰线。</dd> + <dt><code>line-through</code></dt> + <dd>有一条贯穿文本中间的修饰线。</dd> + <dt><code>blink {{deprecated_inline}}</code></dt> + <dd>文本闪烁(文本交替处于显示与隐藏状态)。客户代理都一致没有实现文本闪烁效果。考虑到为了支持使用 <a href="/en-US/docs/Web/CSS/animation">CSS 动画</a>,该值也<strong>不宜使用</strong>。</dd> +</dl> + +<h3 id="格式化语法">格式化语法</h3> + +<pre class="syntaxbox">{{csssyntax}}</pre> + +<h2 id="示例">示例</h2> + +<div id="Examples"> +<pre class="brush: html"><p class="wavy">Here's some text with wavy red underline!</p> +<p class="both">This text has lines both above and below it.</p></pre> + +<pre class="brush: css">.wavy { + text-decoration-line: underline; + text-decoration-style: wavy; + text-decoration-color: red; +} + +.both { + text-decoration-line: underline overline; +}</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-line', 'text-decoration-line')}}</td> + <td>{{Spec2('CSS3 Text Decoration')}}</td> + <td> + <p>初次定义。{{cssxref("text-decoration")}} 属性同时变成了定义多个相关属性的简写形式。</p> + </td> + </tr> + </tbody> +</table> + +<h2 id="浏览器兼容性">浏览器兼容性</h2> + +<p> </p> + + + +<p>{{Compat("css.properties.text-decoration-line")}}</p> + +<p> </p> + +<h2 id="另请参阅">另请参阅</h2> + +<ul> + <li>当要设置多个线修饰属性时,用 {{cssxref("text-decoration")}} 简写属性会比分别写多个属性更方便。</li> +</ul> |