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.

句法

/* Keyword value */
zoom: auto;
/* <number> values */
zoom: 0.8;
zoom: 2.0;
/* <percentage> values */
zoom: 150%;
					

auto
用户代理 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.

形式定义

相关 at-rule @viewport
初始值 auto
百分比 the zoom factor itself
计算值 auto , or a non-negative number or percentage as specified

形式句法

auto | <number> | <percentage>
					

范例

Setting viewport zoom factor

@viewport {
  zoom: 2.0;
}
					

规范

规范 状态 注释
CSS Device Adaptation
The definition of '"zoom" descriptor' in that specification.
工作草案 Initial specification

浏览器兼容性

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. 更新 GitHub 上的兼容性数据
Desktop Mobile
Chrome Edge Firefox Internet Explorer Opera Safari Android webview Chrome for Android Firefox for Android Opera for Android Safari on iOS Samsung Internet
zoom descriptor Chrome 不支持 29 — 84 Edge 完整支持 12 Prefixed
完整支持 12 Prefixed
Prefixed Implemented with the vendor prefix: -ms-
Firefox 不支持 No IE 完整支持 10 Prefixed
完整支持 10 Prefixed
Prefixed Implemented with the vendor prefix: -ms-
Opera 完整支持 16 Safari 不支持 No WebView Android 不支持 4.4 — 37 Chrome Android 不支持 61 — 84 Firefox Android 不支持 No Opera Android 完整支持 16 Safari iOS 不支持 No Samsung Internet Android 完整支持 8.0

图例

完整支持

完整支持

不支持

不支持

要求使用供应商前缀或不同名称。

要求使用供应商前缀或不同名称。

另请参阅

元数据

  • 最后修改: