blob: 284c9a1b4111dce4c3eaf32d0854cb1f3ec22b83 (
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
|
---
title: device-height
slug: Web/CSS/@media/device-height
translation_of: Web/CSS/@media/device-height
---
<div>{{cssref}} {{deprecated_header}}</div>
<p> <strong><code>device-height</code></strong> <a href="/en-US/docs/CSS">CSS</a> <a href="/en-US/docs/Web/CSS/Media_Queries/Using_media_queries#Media_features">media feature</a> 可以用来测试设备的渲染高度。注意,该条媒体查询将会在 媒体查询level4(目前处于候选草案)中废弃</p>
<h2 id="语法">语法</h2>
<p><code>device-height</code> feature is specified as a {{cssxref("<length>")}} value. It is a range feature, meaning that you can also use the prefixed <strong><code>min-device-height</code></strong> and <code><strong>max-device-height</strong></code> variants to query minimum and maximum values, respectively.</p>
<h2 id="例子">例子</h2>
<p>在高度低于800px时加载指定样式</p>
<pre class="brush: html"><link rel="stylesheet" media="screen and (max-device-height: 799px)" href="http://foo.bar.com/short-styles.css" /></pre>
<h2 id="Specifications">Specifications</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('CSS4 Media Queries', '#device-height', 'device-height')}}</td>
<td>{{Spec2('CSS4 Media Queries')}}</td>
<td>Deprecated in Media Queries Level 4.</td>
</tr>
<tr>
<td>{{SpecName('CSS3 Media Queries', '#device-height', 'device-height')}}</td>
<td>{{Spec2('CSS3 Media Queries')}}</td>
<td>Initial definition.</td>
</tr>
</tbody>
</table>
<h2 id="Browser_compatibility">Browser compatibility</h2>
<p>{{Compat("css.at-rules.media.device-height")}}</p>
<p>
<audio style="display: none;"> </audio>
</p>
|