height
概要
高度 的 CSS 描述符是用於設定兩者的簡易描述符 min-height
(en-US) 與 max-height
(en-US) 的可視區域(viewport)。提供一個可視區域的長度值,將設定兩者的最小高度與最大高度的值。
如果提供了兩個可視區域(viewport),第一個值將設定為最小高度,而第二個值將設定為最大高度。
語法
/* One value */
height: auto;
height: 320px;
height: 15em;
/* Two values */
height: 320px 200px;
值
auto
- 使用 CSS 描述符來進行值的計算。
<length>
- 非負絕對值或相對長度。
<percentage>
- 初始可視區域的相對寬度或相對高度百分比的縮放係數為 1.0,且必須是非負數。
正式語法
@viewport { <group-rule-body> }
舉例
@viewport {
height: 500px;
}
格式
Specification | Status | Comment |
---|---|---|
CSS Device Adaptation The definition of '"height" descriptor' in that specification. |
Working Draft | Initial definition |
瀏覽器兼容性
We're converting our compatibility data into a machine-readable JSON format.
This compatibility table still uses the old format,
because we haven't yet converted the data it contains.
Find out how you can help! (en-US)
Feature | Chrome | Firefox (Gecko) | Internet Explorer | Opera | Safari |
---|---|---|---|---|---|
Basic support | 29 (behind a flag) | No support | 10 -ms (en-US) | 11.10 Removed in 15 Reintroduced behind a flag in 16 |
No support |
Feature | Android | Chrome for Android | Firefox Mobile (Gecko) | IE Mobile | Opera Mobile | Safari Mobile |
---|---|---|---|---|---|---|
Basic support | 4.4 | 29 | No support | 10-ms (en-US) | 11.10 Removed in 15 Reintroduced behind a flag in 16 |
No support |