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/dimension | |
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/dimension')
-rw-r--r-- | files/zh-cn/web/css/dimension/index.html | 74 |
1 files changed, 74 insertions, 0 deletions
diff --git a/files/zh-cn/web/css/dimension/index.html b/files/zh-cn/web/css/dimension/index.html new file mode 100644 index 0000000000..367cd4a5d4 --- /dev/null +++ b/files/zh-cn/web/css/dimension/index.html @@ -0,0 +1,74 @@ +--- +title: dimension +slug: Web/CSS/dimension +tags: + - CSS + - CSS数据类型 +translation_of: Web/CSS/dimension +--- +<div>{{CSSRef}}</div> + +<p><strong><code><dimension></code></strong> <a href="/zh-CN/docs/Web/CSS">CSS</a> <a href="/zh-CN/docs/Web/CSS/CSS_Types">数据类型</a>是一个带有单位的{{CSSxRef("<number>")}},例如:<code>10px</code></p> + +<p>CSS使用度量值来描述距离 ({{CSSxRef("<length>")}}),时间({{CSSxRef("<time>")}}),频率({{CSSxRef("<frequency>")}}),分辨率({{CSSxRef("<resolution>")}})以及其他量。</p> + +<h2 id="格式">格式</h2> + +<p> <code><dimension></code> 的格式是一个{{CSSxRef("<number>")}}后紧随一个是标记符的单位,单位大小写不敏感。</p> + +<h2 id="Examples">Examples</h2> + +<h3 id="合法的度量值">合法的度量值</h3> + +<pre class="syntaxbox example-good">12px 12像素 +1rem 1 rem +1.2pt 1.2点 +2200ms 2200毫秒 +200hz 200赫兹 +200Hz 200赫兹(单位大小写不敏感) +</pre> + +<h3 id="非法的度量值">非法的度量值</h3> + +<pre class="syntaxbox example-bad">12 px 单位必须紧随数字,不能有空格 +12"px" 单位是标识符,不能加引号</pre> + +<h2 id="规范">规范</h2> + +<table class="standard-table"> + <thead> + <tr> + <th scope="col">Specification</th> + <th scope="col">状态</th> + <th scope="col">说明</th> + </tr> + </thead> + <tbody> + <tr> + <td>{{SpecName("CSS4 Values", "#dimensions", "<dimension>")}}</td> + <td>{{Spec2("CSS4 Values")}}</td> + <td>添加 <code>cap</code>, <code>ic</code>, <code>lh</code>, <code>rlh</code>, <code>vi</code>, <code>vb</code></td> + </tr> + <tr> + <td>{{SpecName("CSS3 Values", "#dimensions", "<dimension>")}}</td> + <td>{{Spec2("CSS3 Values")}}</td> + <td>添加 <code>ch</code>, <code>rem</code>, <code>vw</code>, <code>vw</code>, <code>vmin</code>,<code> vmax</code>, <code>Q</code></td> + </tr> + <tr> + <td>{{SpecName("CSS2.1", "syndata.html#numbers", "<dimension>")}}</td> + <td>{{Spec2("CSS2.1")}}</td> + <td>Defined under Numbers and Length</td> + </tr> + <tr> + <td>{{SpecName("CSS1", "", "<dimension>")}}</td> + <td>{{Spec2("CSS1")}}</td> + <td>Initial definition under "length units"</td> + </tr> + </tbody> +</table> + +<h2 id="浏览器兼容性">浏览器兼容性</h2> + + + +<p>{{Compat("css.types.dimension")}}</p> |