As far as I know it’s the ratio between the “abstract” resolution and the device’s physical resolution. So I test it (on HTC Desire), the physical resolution is 480x800, it’s logged out the ratio is 1.5. I threw in some elements, but it still take exactly 480px width to fill the viewport where my naive thought it’s need ‘320px’?
As far as I know it’s the ratio between the abstract resolution and the
Share
From http://www.quirksmode.org/blog/archives/2012/07/more_about_devi.html, where the author discusses the differences in devicePixelRatio across mobile devices:
Which leads the author to the following conclusion:
What matters in your case is screen width, plain and simple. The calculation of DIPs is something for the device to take care of, rather than you as the developer. If the device wants to compensate for a different pixel ratio, it will serve you a width in DIP and give the ratio. If it feels that pages should be displayed with the native unmodified pixel resolution, it will serve you that width instead. The author of the post also comes to the following conclusion which I find interesting:
At any rate, use the width the browser gives you and leave it to the device to compensate.