这是
实验性技术
检查
浏览器兼容性表格
要小心谨慎在生产中使用这之前。
viewport-fit
CSS
@viewport
descriptor
controls how a document's viewport fills the screen.
/* Keyword values */ viewport-fit: auto; viewport-fit: contain; viewport-fit: cover;
auto
This value doesn’t affect the initial layout viewport, and the whole web page is viewable.
contain
The viewport is scaled to fit the largest rectangle inscribed within the display.
cover
当使用
viewport-fit
descriptor, one must keep in mind that not all device displays are rectangular, and should therefore make use of the
safe area inset variables
.
| 相关 at-rule |
@viewport
|
|---|---|
| 初始值 |
auto
|
| 计算值 | 如指定 |
auto | contain | cover
@viewport {
viewport-fit: cover;
}
| 规范 | 状态 | 注释 |
|---|---|---|
|
CSS Round Display Level 1
The definition of '"viewport-fit" descriptor' in that specification. |
工作草案 | 初始定义。 |
| Desktop | Mobile | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
viewport-fit
descriptor
|
Chrome 不支持 No | Edge 不支持 No | Firefox 不支持 No | IE 不支持 No | Opera 不支持 No | Safari 不支持 No | WebView Android 不支持 No | Chrome Android 不支持 No | Firefox Android 不支持 No | Opera Android 不支持 No | Safari iOS 不支持 No | Samsung Internet Android 不支持 No |
不支持