From 33058f2b292b3a581333bdfb21b8f671898c5060 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:40:17 -0500 Subject: initial commit --- files/zh-cn/web/css/dimension/index.html | 74 ++++++++++++++++++++++++++++++++ 1 file changed, 74 insertions(+) create mode 100644 files/zh-cn/web/css/dimension/index.html (limited to 'files/zh-cn/web/css/dimension') 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 +--- +
{{CSSRef}}
+ +

<dimension> CSS 数据类型是一个带有单位的{{CSSxRef("<number>")}},例如:10px

+ +

CSS使用度量值来描述距离 ({{CSSxRef("<length>")}}),时间({{CSSxRef("<time>")}}),频率({{CSSxRef("<frequency>")}}),分辨率({{CSSxRef("<resolution>")}})以及其他量。

+ +

格式

+ +

 <dimension> 的格式是一个{{CSSxRef("<number>")}}后紧随一个是标记符的单位,单位大小写不敏感。

+ +

Examples

+ +

合法的度量值

+ +
12px      12像素
+1rem      1 rem
+1.2pt     1.2点
+2200ms    2200毫秒
+200hz     200赫兹
+200Hz     200赫兹(单位大小写不敏感)
+
+ +

非法的度量值

+ +
12 px       单位必须紧随数字,不能有空格
+12"px"      单位是标识符,不能加引号
+ +

规范

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Specification状态说明
{{SpecName("CSS4 Values", "#dimensions", "<dimension>")}}{{Spec2("CSS4 Values")}}添加 cap, ic, lh, rlh, vi, vb
{{SpecName("CSS3 Values", "#dimensions", "<dimension>")}}{{Spec2("CSS3 Values")}}添加 ch, rem, vw, vw, vmin, vmax, Q
{{SpecName("CSS2.1", "syndata.html#numbers", "<dimension>")}}{{Spec2("CSS2.1")}}Defined under Numbers and Length
{{SpecName("CSS1", "", "<dimension>")}}{{Spec2("CSS1")}}Initial definition under "length units"
+ +

浏览器兼容性

+ + + +

{{Compat("css.types.dimension")}}

-- cgit v1.2.3-54-g00ecf