diff options
author | Peter Bengtsson <mail@peterbe.com> | 2020-12-08 14:40:17 -0500 |
---|---|---|
committer | Peter Bengtsson <mail@peterbe.com> | 2020-12-08 14:40:17 -0500 |
commit | 33058f2b292b3a581333bdfb21b8f671898c5060 (patch) | |
tree | 51c3e392513ec574331b2d3f85c394445ea803c6 /files/zh-cn/web/css/@media/-webkit-device-pixel-ratio/index.html | |
parent | 8b66d724f7caf0157093fb09cfec8fbd0c6ad50a (diff) | |
download | translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.gz translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.bz2 translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.zip |
initial commit
Diffstat (limited to 'files/zh-cn/web/css/@media/-webkit-device-pixel-ratio/index.html')
-rw-r--r-- | files/zh-cn/web/css/@media/-webkit-device-pixel-ratio/index.html | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/files/zh-cn/web/css/@media/-webkit-device-pixel-ratio/index.html b/files/zh-cn/web/css/@media/-webkit-device-pixel-ratio/index.html new file mode 100644 index 0000000000..d3f3cd202c --- /dev/null +++ b/files/zh-cn/web/css/@media/-webkit-device-pixel-ratio/index.html @@ -0,0 +1,60 @@ +--- +title: '-webkit-device-pixel-ratio' +slug: Web/CSS/@media/-webkit-device-pixel-ratio +translation_of: Web/CSS/@media/-webkit-device-pixel-ratio +--- +<div>{{ CSSRef() }}</div> + +<p>{{ Non-standard_header() }}</p> + +<p><strong><code>-webkit-device-pixel-ratio</code></strong> 是一个非标准的布尔类型CSS媒体类型,是标准 <a href="/en-US/docs/Web/CSS/@media/resolution"><code>resolution</code></a> 媒体类型的一个替代方案.</p> + +<p>Its value is the number of device pixels used to represent each <a href="/en-US/docs/Web/CSS/length#Absolute_length_units">CSS <code>px</code></a>. Although the value is a {{cssxref("<number>")}} and thus doesn't syntactically allow units, its implicit unit is <a href="/en-US/docs/Web/CSS/resolution#dppx"><code>dppx</code></a>.</p> + +<h3 id="Syntax" name="Syntax">Syntax</h3> + +<p><strong><code>-webkit-device-pixel-ratio</code></strong> is a range value meaning the prefixed <strong><code>-webkit-min-device-pixel-ratio</code></strong> and <strong><code>-webkit-max-device-pixel-ratio</code></strong> are also available.</p> + +<pre class="brush: css">@media (-webkit-min-device-pixel-ratio: 2) { ... } +/* is equivalent to */ +@media (min-resolution: 2dppx) { ... } + +/* And likewise */ +@media (-webkit-max-device-pixel-ratio: 2) { ... } +/* is equivalent to */ +@media (max-resolution: 2dppx) { ... } +</pre> + +<h3 id="Specifications" name="Specifications">Specifications</h3> + +<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('Compat', '#css-media-queries-webkit-device-pixel-ratio', '-webkit-device-pixel-ratio')}}</td> + <td>{{Spec2('Compat')}}</td> + <td>Initial standardization</td> + </tr> + <tr> + <td><a class="external external-icon" href="https://developer.apple.com/library/safari/documentation/AppleApplications/Reference/SafariCSSRef/Articles/OtherStandardCSS3Features.html#//apple_ref/doc/uid/TP40007601-SW3" hreflang="en" lang="en">Safari CSS Reference<br> + <small lang="en-US">'media query extensions' in that document.</small></a></td> + <td>Non-standard unofficial documentation</td> + <td>Initial documentation</td> + </tr> + </tbody> +</table> + +<h3 id="See_also" name="See_also">See also</h3> + +<ul> + <li><a href="/en-US/docs/Web/CSS/@media/-webkit-transform-2d"><code>-webkit-transform-2d</code></a></li> + <li><a href="/en-US/docs/Web/CSS/@media/-webkit-transform-3d"><code>-webkit-transform-3d</code></a></li> + <li><a href="/en-US/docs/Web/CSS/@media/-webkit-transition"><code>-webkit-transition</code></a></li> + <li><a href="/en-US/docs/Web/CSS/@media/-webkit-animation"><code>-webkit-animation</code></a></li> +</ul> |