aboutsummaryrefslogtreecommitdiff
path: root/files/zh-tw/conflicting/web/css/@viewport/index.html
blob: 02dd2cafa40691a45efba286c6f873137bdecbb0 (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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
---
title: height
slug: conflicting/Web/CSS/@viewport
translation_of: Web/CSS/@viewport
translation_of_original: Web/CSS/@viewport/height
original_slug: Web/CSS/@viewport/height
---
<div>{{CSSRef}}</div>

<h2 id="概要">概要</h2>

<p><font face="Consolas, Liberation Mono, Courier, monospace"><strong>高度 </strong></font>的 CSS 描述符是用於設定兩者的簡易描述符 {{cssxref("@viewport/min-height", "min-height")}}{{cssxref("@viewport/max-height", "max-height")}} 的可視區域(viewport)。提供一個可視區域的長度值,將設定兩者的最小高度與最大高度的值。</p>

<p>如果提供了兩個可視區域(viewport),第一個值將設定為最小高度,而第二個值將設定為最大高度。</p>

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

<pre class="brush: css">/* One value */
height: auto;
height: 320px;
height: 15em;

/* Two values */
height: 320px 200px;
</pre>

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

<dl>
 <dt><code>auto</code></dt>
 <dd>使用 CSS 描述符來進行值的計算。</dd>
 <dt><code>&lt;length&gt;</code></dt>
 <dd>非負絕對值或相對長度。</dd>
 <dt><code>&lt;percentage&gt;</code></dt>
 <dd>初始可視區域的相對寬度或相對高度百分比的縮放係數為 1.0,且必須是非負數。</dd>
</dl>

<h3 id="正式語法">正式語法</h3>

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

<h2 id="舉例">舉例</h2>

<pre class="brush: css">@viewport {
  height: 500px;
}</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', '#descdef-viewport-height', '"height" descriptor')}}</td>
   <td>{{Spec2('CSS3 Device')}}</td>
   <td>Initial definition</td>
  </tr>
 </tbody>
</table>

<h2 id="瀏覽器兼容性">瀏覽器兼容性</h2>

<p>{{CompatibilityTable}}</p>

<div id="compat-desktop">
<table class="compat-table">
 <tbody>
  <tr>
   <th>Feature</th>
   <th>Chrome</th>
   <th>Firefox (Gecko)</th>
   <th>Internet Explorer</th>
   <th>Opera</th>
   <th>Safari</th>
  </tr>
  <tr>
   <td>Basic support</td>
   <td>29 (behind a flag)</td>
   <td>{{CompatNo}}</td>
   <td>10 {{property_prefix("-ms")}}</td>
   <td>11.10<br>
    Removed in 15<br>
    Reintroduced behind a flag in 16</td>
   <td>{{CompatNo}}</td>
  </tr>
 </tbody>
</table>
</div>

<div id="compat-mobile">
<table class="compat-table">
 <tbody>
  <tr>
   <th>Feature</th>
   <th>Android</th>
   <th>Chrome for Android</th>
   <th>Firefox Mobile (Gecko)</th>
   <th>IE Mobile</th>
   <th>Opera Mobile</th>
   <th>Safari Mobile</th>
  </tr>
  <tr>
   <td>Basic support</td>
   <td>4.4</td>
   <td>29</td>
   <td>{{CompatNo}}</td>
   <td>10{{property_prefix("-ms")}}</td>
   <td>11.10<br>
    Removed in 15<br>
    Reintroduced behind a flag in 16</td>
   <td>{{CompatNo}}</td>
  </tr>
 </tbody>
</table>
</div>