我想知道如何计算-webkit-device-pixel-ratio.我已经读过这个:
http://www.quirksmode.org/blog/archives/2012/06/devicepixelrati.html.Yet我无法理解清楚.
我还想知道是否有一个列表,哪些设备使用哪个像素比.安卓网站说
The Android Browser and WebView support a CSS media feature that allows you to create styles for specific screen densities—the -webkit-device-pixel-ratio CSS media feature. The value you apply to this feature should be either “0.75”, “1”, or “1.5”, to indicate that the styles are for devices with low density, medium density, or high density screens, respectively.
但我发现我们需要使用-webkit-device-pixel-ratio = 2来使网络应用程序在768 x 1280分辨率屏幕上兼容.
解决方法:
根据这篇文章
神奇的数字似乎是150.
将物理ppi除以150的理想ppi,得出器件像素比.
例如.具有445ppi的设备将具有3的dpr – >> 445/150
对于此列表中的许多项目,简单的计算似乎都没问题,
标签:html,android,css,android-layout
来源: https://codeday.me/bug/20191004/1854301.html