--- title: height slug: conflicting/Web/CSS/@viewport translation_of: Web/CSS/@viewport translation_of_original: Web/CSS/@viewport/height original_slug: Web/CSS/@viewport/height ---
高度 的 CSS 描述符是用於設定兩者的簡易描述符 {{cssxref("@viewport/min-height", "min-height")}} 與 {{cssxref("@viewport/max-height", "max-height")}} 的可視區域(viewport)。提供一個可視區域的長度值,將設定兩者的最小高度與最大高度的值。
如果提供了兩個可視區域(viewport),第一個值將設定為最小高度,而第二個值將設定為最大高度。
/* One value */ height: auto; height: 320px; height: 15em; /* Two values */ height: 320px 200px;
auto
<length>
<percentage>
@viewport { height: 500px; }
Specification | Status | Comment |
---|---|---|
{{SpecName('CSS3 Device', '#descdef-viewport-height', '"height" descriptor')}} | {{Spec2('CSS3 Device')}} | Initial definition |
{{CompatibilityTable}}
Feature | Chrome | Firefox (Gecko) | Internet Explorer | Opera | Safari |
---|---|---|---|---|---|
Basic support | 29 (behind a flag) | {{CompatNo}} | 10 {{property_prefix("-ms")}} | 11.10 Removed in 15 Reintroduced behind a flag in 16 |
{{CompatNo}} |
Feature | Android | Chrome for Android | Firefox Mobile (Gecko) | IE Mobile | Opera Mobile | Safari Mobile |
---|---|---|---|---|---|---|
Basic support | 4.4 | 29 | {{CompatNo}} | 10{{property_prefix("-ms")}} | 11.10 Removed in 15 Reintroduced behind a flag in 16 |
{{CompatNo}} |