Non-standard
This feature is non-standard and is not on a standards track. Do not use it on production sites facing the Web: it will not work for every user. There may also be large incompatibilities between implementations and the behavior may change in the future.
The non-standard zoom
CSS property can be used to control the magnification level of an element. transform: scale()
should be used instead of this property, if possible. However, unlike CSS Transforms, zoom
affects the layout size of the element.
/* Keyword values */ zoom: normal; zoom: reset; /* <percentage> values */ zoom: 50%; zoom: 200%; /* <number> values */ zoom: 1.1; zoom: 0.7; /* Global values */ zoom: inherit; zoom: initial; zoom: unset;
Initial value | normal |
---|---|
Applies to | all elements |
Inherited | no |
Media | visual |
Computed value | as specified |
Animation type | an integer |
Canonical order | the unique non-ambiguous order defined by the formal grammar |
normal
reset
<percentage>
100%
is equivalent to normal
. Values larger than 100%
zoom in. Values smaller than 100%
zoom out.<number>
1.0
= 100%
= normal
). Values larger than 1.0
zoom in. Values smaller than 1.0
zoom out.normal | reset | <number> | <percentage>
<p class="small">Small</p> <p class="normal">Normal</p> <p class="big">Big</p>
p.small { zoom: 75%; } p.normal { zoom: normal; } p.big { zoom: 2.5; } p { display: inline-block; } p:hover { zoom: reset; }
<div id="a" class="circle"></div> <div id="b" class="circle"></div> <div id="c" class="circle"></div>
div.circle { width: 25px; height: 25px; border-radius: 100%; text-align: center; vertical-align: middle; display: inline-block; zoom: 1.5; } div#a { background-color: gold; zoom: normal; } div#b { background-color: green; zoom: 200%; } div#c { background-color: blue; zoom: 2.9; }
This property is nonstandard and originated in Internet Explorer. Apple has a description in the Safari CSS Reference. Rossen Atanassov of Microsoft has an unofficial draft specification proposal on GitHub.
Desktop | ||||||
---|---|---|---|---|---|---|
Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | |
Basic support | Yes | 12 | No
|
5.5 | 15 | 4 |
The reset value
|
? | No | No | No | ? | Yes |
Mobile | |||||||
---|---|---|---|---|---|---|---|
Android webview | Chrome for Android | Edge Mobile | Firefox for Android | Opera for Android | iOS Safari | Samsung Internet | |
Basic support | Yes | Yes | 12 | No
|
14 | 4 | ? |
The reset value
|
? | ? | No | No | ? | Yes | ? |
zoom
entry in CSS-Tricks' CSS Almanaczoom
viewport descriptor, for use with @viewport
zoom
property for CSS on the Firefox issue tracker Bugzilla
© 2005–2018 Mozilla Developer Network and individual contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/CSS/zoom