This is an experimental technology
Check the Browser compatibility table carefully before using this in production.
The 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
contain
cover
When using the 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.
Related at-rule | @viewport |
---|---|
Initial value | auto |
Computed value | as specified |
auto | contain | cover
@viewport { viewport-fit: cover; }
Specification | Status | Comment |
---|---|---|
CSS Round Display Level 1 The definition of '"viewport-fit" descriptor' in that specification. | Working Draft | Initial definition. |
Desktop | ||||||
---|---|---|---|---|---|---|
viewport-fit descriptor |
No | No | No | No | No | No |
Mobile | ||||||
---|---|---|---|---|---|---|
viewport-fit descriptor |
No | No | No | No | No | No |
© 2005–2020 Mozilla and individual contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/CSS/@viewport/viewport-fit