最大寬度 | @viewport.max-width (Device Adaptation) - CSS 中文開發手冊css
max-widthCSS描述符指定經過定義的文檔的視口的最大寬度@viewportat-rule。html
默認狀況下,在考慮最大寬度約束的狀況下,寬度將盡量接近初始視圖。瀏覽器
Related at-ruleide |
@viewportorm |
---|---|
初始值htm |
autoip |
Percentagesci |
refer to the width 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 */ max-width: auto; max-width: none; /* <length> values */ max-width: 600px; max-width: 80em; max-width: 15cm; /* <percentage> value */ max-width: 75%;
auto使用的值是從其餘CSS描述符的值中計算出來的。無使用的值是從其餘CSS描述符的值中計算出來的。<length>非負的絕對或相對長度。<percentage>相對於初始視口寬度的百分比值,對於水平長度,縮放係數爲1.0。必須是非負的。
<viewport-length>where <viewport-length> = auto | <length-percentage> where <length-percentage> = <length> | <percentage>
Specification |
Status |
Comment |
---|---|---|
CSS Device AdaptationThe definition of '"max-width" descriptor' in that specification. |
Working Draft |
Initial definition |
Feature |
Chrome |
Firefox (Gecko) |
Internet Explorer |
Opera |
Safari |
---|---|---|---|---|---|
Basic support |
29 (behind a flag) |
No support |
10 -ms |
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 |
11.10 Removed in 15 Reintroduced behind a flag in 16 |
No support |