W3cubDocs

/CSS

@viewport.zoom

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 compatibilityUpdate compatibility data on GitHub

Desktop
Chrome Edge Firefox Internet Explorer Opera Safari
zoom descriptor 29 — 84 12
Prefixed
12
Prefixed
Prefixed Implemented with the vendor prefix: -ms-
No 10
Prefixed
10
Prefixed
Prefixed Implemented with the vendor prefix: -ms-
16 No
Mobile
Android webview Chrome for Android Firefox for Android Opera for Android Safari on iOS Samsung Internet
zoom descriptor 4.4 — 37 61 — 84 No 16 No 8.0

See also

© 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/zoom