aboutsummaryrefslogtreecommitdiff
path: root/files/zh-cn/web/css/@viewport/zoom/index.html
blob: 894e8a6c73f53e71981106f26e6c86fae57ef242 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
---
title: zoom
slug: Web/CSS/@viewport/zoom
tags:
  - CSS
  - CSS Descriptor
translation_of: Web/CSS/@viewport
translation_of_original: Web/CSS/@viewport/zoom
---
<div>{{ CSSRef }}</div>

<p><strong><code>zoom</code></strong> <a href="/en-US/docs/Web/CSS">CSS</a> 属性会根据 {{cssxref("@viewport")}} 来初始化一个缩放因数。</p>

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

<p>{{cssinfo}}</p>

<h2 id="语法">语法</h2>

<pre class="brush:css">/* Keyword value */
zoom: auto;

/* &lt;number&gt; values */
zoom: 0.8;
zoom: 2.0;

/* &lt;percentage&gt; values */
zoom: 150%;
</pre>

<h3 id="值"></h3>

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

<h3 id="形式语法">形式语法</h3>

<pre class="syntaxbox">{{csssyntax}}</pre>

<h2 id="规范">规范</h2>

<table class="standard-table">
 <thead>
  <tr>
   <th scope="col">Specification</th>
   <th scope="col">Status</th>
   <th scope="col">Comment</th>
  </tr>
 </thead>
 <tbody>
  <tr>
   <td>{{SpecName('CSS3 Device', '#zoom-desc', '"zoom" descriptor')}}</td>
   <td>{{Spec2('CSS3 Device')}}</td>
   <td>Initial specification</td>
  </tr>
 </tbody>
</table>

<h2 id="浏览器兼容">浏览器兼容</h2>



<p>{{Compat("css.at-rules.viewport.zoom")}}</p>