zoom

zoom CSS 属性会根据 @viewport 来初始化一个缩放因数。

当设置1.0 或 100%时表示不缩放。更大的值放大,更小的值缩小。

Related at-rule@viewport
初始值auto
Percentagesthe zoom factor itself
计算值auto, or a non-negative number or percentage as specified

语法

/* Keyword value */
zoom: auto;

/* <number> values */
zoom: 0.8;
zoom: 2.0;

/* <percentage> values */
zoom: 150%;

auto
根据`viewport`来既定当前标签的缩放。
<number>
必须是一个非负数。1表示没有缩放,大于1表示放大的倍数,小于1亦然。
<percentage>
必须是一个非负的百分比。以100%为基础进行缩放。

形式语法

auto | <number> | <percentage>

规范

Specification Status Comment
CSS Device Adaptation
"zoom" descriptor
Working Draft Initial specification

浏览器兼容

Update compatibility data on GitHub
DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internet
zoom descriptorChrome No support 29 — 84Edge Full support 12
Prefixed
Full support 12
Prefixed
Prefixed Implemented with the vendor prefix: -ms-
Firefox No support NoIE Full support 10
Prefixed
Full support 10
Prefixed
Prefixed Implemented with the vendor prefix: -ms-
Opera Full support 16Safari No support NoWebView Android No support 4.4 — 37Chrome Android No support 61 — 84Firefox Android No support NoOpera Android Full support 16Safari iOS No support NoSamsung 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.