aboutsummaryrefslogtreecommitdiff
path: root/files/zh-cn/web/css/@counter-style/pad
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/@counter-style/pad
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/@counter-style/pad')
-rw-r--r--files/zh-cn/web/css/@counter-style/pad/index.html86
1 files changed, 86 insertions, 0 deletions
diff --git a/files/zh-cn/web/css/@counter-style/pad/index.html b/files/zh-cn/web/css/@counter-style/pad/index.html
new file mode 100644
index 0000000000..9dcfb0328a
--- /dev/null
+++ b/files/zh-cn/web/css/@counter-style/pad/index.html
@@ -0,0 +1,86 @@
+---
+title: pad
+slug: Web/CSS/@counter-style/pad
+translation_of: Web/CSS/@counter-style/pad
+---
+<div>{{CSSRef}}</div>
+
+<p><span class="seoSummary"><strong><code>pad</code></strong>属性和自定义记数样式一起使用时, 可以用来限定记数样式的最小长度. 如果某个记数样式小于pad所指定的长度, 那么会用pad指定的填充字符串来填充至指定长度. 如果比pad所指定的长度长, 则会正常显示.</span> Pad 属性的第一个参数是最小长度, 第二个参数是填充字符串. 一个常见的用处是序号编号需要填充两位的时候, 即需要编号"01","02","03",……, 而不仅仅是1, 2, 3...</p>
+
+<p>{{cssinfo}}</p>
+
+<h2 id="参数">参数</h2>
+
+<pre class="brush: css">pad: 3 "0";
+</pre>
+
+<h3 id="参数值">参数值</h3>
+
+<dl>
+ <dt><code>&lt;integer&gt; &amp;&amp; &lt;symbol&gt;</code></dt>
+ <dd><code>&lt;integer&gt;</code> 表示所有计数样式必须达到的最小长度(必须是非负整数). 如果指定的最小长度没有达到, 将会用<code>&lt;symbol&gt;</code>来填充直到最小长度.</dd>
+</dl>
+
+<h3 id="形式语法">形式语法</h3>
+
+<pre class="syntaxbox">{{csssyntax}}</pre>
+
+<h2 id="Example" name="Example">样例</h2>
+
+<h3 id="HTML">HTML</h3>
+
+<pre class="brush: html">&lt;ul class="list"&gt;
+  &lt;li&gt;One&lt;/li&gt;
+  &lt;li&gt;Two&lt;/li&gt;
+  &lt;li&gt;Three&lt;/li&gt;
+  &lt;li&gt;Four&lt;/li&gt;
+  &lt;li&gt;Five&lt;/li&gt;
+&lt;/ul&gt;</pre>
+
+<h3 id="CSS">CSS</h3>
+
+<pre class="brush: css">@counter-style pad-example {
+  system: numeric;
+  symbols: "0" "1" "2" "3" "4" "5";
+  pad: 2 "0";
+}
+
+.list {
+  list-style: pad-example;
+}</pre>
+
+<h3 id="结果">结果</h3>
+
+<p>{{ EmbedLiveSample('Example', '', '', '', 'Web/CSS/@counter-style/pad') }}</p>
+
+<h2 id="Specifications" name="Specifications">Specifications</h2>
+
+<table class="standard-table">
+ <thead>
+ <tr>
+ <th scope="col">Specification</th>
+ <th scope="col">Status</th>
+ <th scope="col">Comment</th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr>
+ <td>{{SpecName('CSS3 Counter Styles', '#descdef-counter-style-pad', 'pad')}}</td>
+ <td>{{Spec2('CSS3 Counter Styles')}}</td>
+ <td>Initial definition</td>
+ </tr>
+ </tbody>
+</table>
+
+<h2 id="浏览器兼容性">浏览器兼容性</h2>
+
+
+
+<p>{{Compat("css.at-rules.counter-style.pad")}}</p>
+
+<h2 id="参见">参见</h2>
+
+<ul>
+ <li>{{Cssxref("list-style")}}, {{Cssxref("list-style-image")}}, {{Cssxref("list-style-position")}}</li>
+ <li>{{cssxref("symbols", "symbols()")}}, 该功能符号创建匿名计数器样式 .</li>
+</ul>