这篇翻译不完整。请帮忙从英语翻译这篇文章

分辨率:用于描述媒体查询中的分辨率的<resolution> CSS数据类型表示输出设备的像素密度。

在屏幕上,单位与CSS英寸,厘米或像素有关,而与物理值无关。

Syntax

<resolution>数据类型由严格为正<number>组成,后跟下面列出的单位之一。与所有CSS维度一样,单位字面值与数字之间没有空格。

单位

dpi
表示每英寸的点数。屏幕通常每英寸包含72或96个点,但打印文档的dpi通常要大得多。 1英寸是2.54厘米,1dpi≈0.39dpcm。
dpcm
每厘米上的点数。1英寸是2.54厘米, 1dpcm ≈ 2.54dpi.
dppx
表示每个px的点数。 由于CSS px的固定比率为1:96,因此1dppx相当于96dpi。 which corresponds to the default resolution of images displayed in CSS as defined by image-resolution.
x
 dppx 的别名

Note: Although the number 0 is always the same regardless of unit, the unit may not be omitted. In other words, 0 is invalid and does not represent 0dpi, 0dpcm, or 0dppx.

Examples

Use in a media query

@media print and (min-resolution: 300dpi) { ... }

Valid resolutions

96dpi
50.82dpcm
3dppx

Invalid resolutions

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.

Specifications

Specification Status Comment
CSS Values and Units Module Level 4
<resolution>
Editor's Draft Adds the x unit.
CSS Values and Units Module Level 3
<resolution>
Candidate Recommendation Adds the dppx unit.
Media Queries
<resolution>
Recommendation Initial definition.

Browser compatibility

Update compatibility data on GitHub
DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internet
<resolution>Chrome Full support 29Edge Full support 12Firefox Full support 8
Full support 8
Partial support 3.5
Notes
Notes Supports <integer> values only.
IE Full support 9Opera Full support 9.5Safari No support No
Notes
No support No
Notes
Notes See bug 78087.
WebView Android Full support ≤37Chrome Android Full support 29Firefox Android Full support 8
Full support 8
Partial support 4
Notes
Notes Supports <integer> values only.
Opera Android Full support YesSafari iOS No support No
Notes
No support No
Notes
Notes See bug 78087.
Samsung Internet Android Full support 1.5
dpcm unitChrome Full support 29Edge Full support 12Firefox Full support 8IE Full support 9Opera Full support 16
Full support 16
No support 10 — 15
Safari No support NoWebView Android Full support ≤37Chrome Android Full support 29Firefox Android Full support 8Opera Android Full support 16
Full support 16
No support 10.1 — 14
Safari iOS No support NoSamsung Internet Android Full support Yes
dpi unitChrome Full support 29Edge Full support 12Firefox Full support 8IE Full support 9Opera Full support 16
Full support 16
No support 10 — 15
Safari No support NoWebView Android Full support ≤37Chrome Android Full support 29Firefox Android Full support 8Opera Android Full support 16
Full support 16
No support 10.1 — 14
Safari iOS No support NoSamsung Internet Android Full support Yes
dppx unitChrome Full support 29Edge Full support 12Firefox Full support 16IE No support NoOpera Full support 12.1Safari No support NoWebView Android Full support ≤37Chrome Android Full support 29Firefox Android Full support 16Opera Android Full support 12.1Safari iOS No support NoSamsung Internet Android Full support Yes
x unitChrome Full support 68Edge No support NoFirefox Full support 62IE No support NoOpera Full support YesSafari No support NoWebView Android Full support 68Chrome Android Full support 68Firefox Android Full support 62Opera Android Full support YesSafari iOS No support NoSamsung Internet Android No support No

Legend

Full support  
Full support
No support  
No support
See implementation notes.
See implementation notes.

See also

文档标签和贡献者

标签: 
此页面的贡献者: loveloki, jason-guo
最后编辑者: loveloki,