The zoom
CSS descriptor sets the initial zoom factor of a document defined by the @viewport
at-rule.
A zoom factor of 1.0
or 100%
corresponds to no zooming. Larger values are zoomed in. Smaller values are zoomed out.
Syntax
/* Keyword value */ zoom: auto; /* <number> values */ zoom: 0.8; zoom: 2.0; /* <percentage> values */ zoom: 150%;
Values
auto
- The user agent will set the document's initial zoom factor. The user agent may use the size of canvas area on which the document is rendered to determine that factor.
<number>
- A non-negative number used as the zoom factor.
<percentage>
- A non-negative percentage value used as the zoom factor.
Formal definition
Related at-rule | @viewport |
---|---|
Initial value | auto |
Percentages | the zoom factor itself |
Computed value | auto , or a non-negative number or percentage as specified |
Formal syntax
auto | <number> | <percentage>
Examples
Setting viewport zoom factor
@viewport {
zoom: 2.0;
}
Specifications
Specification | Status | Comment |
---|---|---|
CSS Device Adaptation The definition of '"zoom" descriptor' in that specification. |
Working Draft | Initial specification |
Browser compatibility
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.
Desktop | Mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
zoom descriptor | Chrome No support 29 — 84 | Edge
Full support
12
| Firefox No support No | IE
Full support
10
| Opera Full support 16 | Safari No support No | WebView Android No support 4.4 — 37 | Chrome Android No support 61 — 84 | Firefox Android No support No | Opera Android Full support 16 | Safari iOS No support No | Samsung Internet Android Full support 8.0 |
Legend
- Full support
- Full support
- No support
- No support
- Requires a vendor prefix or different name for use.
- Requires a vendor prefix or different name for use.