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

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

Related at-rule@viewport
初始值auto
Percentagesthe zoom factor itself
适用媒体as each of the properties of the shorthand:
计算值auto, or a non-negative number or percentage as specified
正规顺序the unique non-ambiguous order defined by the formal grammar

语法

/* 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 AndroidEdge MobileFirefox for AndroidOpera for AndroidiOS SafariSamsung Internet
Basic supportChrome Full support 29Edge ? Firefox No support NoIE Full support 10
Prefixed
Full support 10
Prefixed
Prefixed Requires the vendor prefix: -ms-
Opera Full support 16Safari No support NoWebView Android Full support 4.4Chrome Android Full support 61Edge Mobile ? Firefox Android No support NoOpera Android Full support 37Safari iOS ? Samsung Internet Android No support No

Legend

Full support  
Full support
No support  
No support
Compatibility unknown  
Compatibility unknown
Requires a vendor prefix or different name for use.
Requires a vendor prefix or different name for use.

文档标签和贡献者

标签: 
此页面的贡献者: zhangchen, azhi09
最后编辑者: zhangchen,