aboutsummaryrefslogtreecommitdiff
path: root/files/zh-cn/web/css/resolution
diff options
context:
space:
mode:
authorPeter Bengtsson <mail@peterbe.com>2020-12-08 14:40:17 -0500
committerPeter Bengtsson <mail@peterbe.com>2020-12-08 14:40:17 -0500
commit33058f2b292b3a581333bdfb21b8f671898c5060 (patch)
tree51c3e392513ec574331b2d3f85c394445ea803c6 /files/zh-cn/web/css/resolution
parent8b66d724f7caf0157093fb09cfec8fbd0c6ad50a (diff)
downloadtranslated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.gz
translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.bz2
translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.zip
initial commit
Diffstat (limited to 'files/zh-cn/web/css/resolution')
-rw-r--r--files/zh-cn/web/css/resolution/index.html98
1 files changed, 98 insertions, 0 deletions
diff --git a/files/zh-cn/web/css/resolution/index.html b/files/zh-cn/web/css/resolution/index.html
new file mode 100644
index 0000000000..c388088a35
--- /dev/null
+++ b/files/zh-cn/web/css/resolution/index.html
@@ -0,0 +1,98 @@
+---
+title: <resolution>
+slug: Web/CSS/resolution
+tags:
+ - CSS
+ - 参考系
+ - 布局
+translation_of: Web/CSS/resolution
+---
+<div>{{CSSRef}}</div>
+
+<div>分辨率:用于描述<a href="/en-US/docs/Web/CSS/Media_Queries">媒体查询</a>中的分辨率的&lt;resolution&gt; CSS<a href="/en-US/docs/Web/CSS/CSS_Types">数据类型</a>表示输出设备的像素密度。</div>
+
+<p>在屏幕上,单位与CSS英寸,厘米或像素有关,而与物理值无关。</p>
+
+<h2 id="Syntax">Syntax</h2>
+
+<p>&lt;resolution&gt;数据类型由严格为正{{cssxref("&lt;number&gt;")}}组成,后跟下面列出的单位之一。与所有CSS维度一样,单位字面值与数字之间没有空格。</p>
+
+<h3 id="单位">单位</h3>
+
+<dl>
+ <dt><a id="dpi" name="dpi"><code id="dpi">dpi</code></a></dt>
+ <dd>表示<a href="https://en.wikipedia.org/wiki/Dots_per_inch">每英寸的点数</a>。屏幕通常每英寸包含72或96个点,但打印文档的dpi通常要大得多。 1英寸是2.54厘米,1dpi≈0.39dpcm。</dd>
+ <dt><a id="dpcm" name="dpcm"><code id="dpcm">dpcm</code></a></dt>
+ <dd><a href="https://en.wikipedia.org/wiki/Dots_per_inch">每厘米上的点数</a>。1英寸是2.54厘米, <code>1dpcm ≈ 2.54dpi</code>.</dd>
+ <dt><a id="dppx" name="dppx"><code id="dppx">dppx</code></a></dt>
+ <dd>表示每个<code><a href="/en-US/docs/Web/CSS/length#px">px</a></code>的点数。 由于CSS px的固定比率为1:96,因此1dppx相当于96dpi。 which corresponds to the default resolution of images displayed in CSS as defined by {{cssxref("image-resolution")}}.</dd>
+ <dt><a id="x" name="x"><code>x</code></a></dt>
+ <dd> <code>dppx</code> 的别名</dd>
+</dl>
+
+<div class="note">
+<p><strong>Note:</strong> Although the number <code>0</code> is always the same regardless of unit, the unit may not be omitted. In other words, <code>0</code> is invalid and does not represent <code>0dpi</code>, <code>0dpcm</code>, or <code>0dppx</code>.</p>
+</div>
+
+<h2 id="Examples">Examples</h2>
+
+<h3 id="Use_in_a_media_query">Use in a media query</h3>
+
+<pre class="brush: css">@media print and (min-resolution: 300dpi) { ... }</pre>
+
+<h3 id="Valid_resolutions">Valid resolutions</h3>
+
+<pre>96dpi
+50.82dpcm
+3dppx
+</pre>
+
+<h3 id="Invalid_resolutions">Invalid resolutions</h3>
+
+<pre class="example-bad">72 dpi Spaces are not allowed between the number and the unit.
+ten dpi The number must use digits only.
+0 The unit is required.
+</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 Values', '#resolution', '&lt;resolution&gt;')}}</td>
+ <td>{{Spec2('CSS4 Values')}}</td>
+ <td>Adds the <code>x</code> unit.</td>
+ </tr>
+ <tr>
+ <td>{{SpecName('CSS3 Values', '#resolution', '&lt;resolution&gt;')}}</td>
+ <td>{{Spec2('CSS3 Values')}}</td>
+ <td>Adds the <code>dppx</code> unit.</td>
+ </tr>
+ <tr>
+ <td>{{SpecName('CSS3 Media Queries', '#resolution', '&lt;resolution&gt;')}}</td>
+ <td>{{Spec2('CSS3 Media Queries')}}</td>
+ <td>Initial definition.</td>
+ </tr>
+ </tbody>
+</table>
+
+<h2 id="Browser_compatibility">Browser compatibility</h2>
+
+<div>
+
+
+<p>{{Compat("css.types.resolution")}}</p>
+</div>
+
+<h2 id="See_also">See also</h2>
+
+<ul>
+ <li><a href="/en-US/docs/Web/CSS/@media/resolution">resolution</a> media feature</li>
+</ul>