-webkit-device-pixel-ratio

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

非标准
该特性是非标准的,请尽量不要在生产环境中使用它!

-webkit-device-pixel-ratio 是一个非标准的布尔类型CSS媒体类型,是标准 resolution 媒体类型的一个替代方案.

Its value is the number of device pixels used to represent each CSS px. Although the value is a <number> and thus doesn't syntactically allow units, its implicit unit is dppx.

Syntax

-webkit-device-pixel-ratio is a range value meaning the prefixed -webkit-min-device-pixel-ratio and -webkit-max-device-pixel-ratio are also available.

@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) { ... }

Specifications

Specification Status Comment
Web Compatibility Standard
-webkit-device-pixel-ratio
Living Standard Initial standardization
Safari CSS Reference
'media query extensions' in that document.
Non-standard unofficial documentation Initial documentation

See also

文档标签和贡献者

 此页面的贡献者: charlie
 最后编辑者: charlie,