zoom
CSS 属性会根据 @viewport
来初始化一个缩放因数。
当设置1.0
或 100%
时表示不缩放。更大的值放大,更小的值缩小。
Related at-rule | @viewport |
---|---|
初始值 | auto |
Percentages | the 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 |
浏览器兼容
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.
Feature | Chrome | Edge | Firefox | Internet Explorer | Opera | Safari |
---|---|---|---|---|---|---|
Basic support | 29 | ? | No | 10 -ms- | 16 | No |
Feature | Android webview | Chrome for Android | Edge mobile | Firefox for Android | Opera Android | iOS Safari | Samsung Internet |
---|---|---|---|---|---|---|---|
Basic support | 4.4 | 61 | ? | No | 37 | ? | No |