CSS

最小高度 | @viewport.min-height

@viewport.min-height

min-heightCSS描述符指定通过@viewport的at-rule定义的一个文件视区的最小高度。

考虑到最小高度限制,最初将高度设置为尽可能接近初始视口高度。

Related at-rule@viewport
初始值auto
百分比值refer to the height of the initial viewport
媒体visual, continuous
计算值if specified as a length, the corresponding absolute length; if specified as a percentage, the specified value; otherwise, auto
规范顺序the unique non-ambiguous order defined by the formal grammar

语法

/* Keyword value */ min-height: auto; /* <length> values */ min-height: 120px; min-height: 20em; min-height: 10cm; /* <percentage> value */ min-height: 25%;

auto使用的值是从其他CSS描述符的值中计算出来的。

形式语法

<viewport-length>where <viewport-length> = auto | <length-percentage> where <length-percentage> = <length> | <percentage>

@viewport { min-height: 200px; }

规范

SpecificationStatusComment
CSS Device AdaptationThe definition of '"min-height" descriptor' in that specification.Working DraftInitial definition

浏览器兼容性

FeatureChromeFirefox (Gecko)Internet ExplorerOperaSafari
Basic support29 (behind a flag)No support10 -ms11.10 Removed in 15 Reintroduced behind a flag in 16No support

FeatureAndroidChrome for AndroidFirefox Mobile (Gecko)IE MobileOpera MobileSafari Mobile
Basic support4.429No support10-ms11.10 Removed in 15 Reintroduced behind a flag in 16No support