devicepixelratio不匹配期望
我的监视器具有本地分辨率3072宽度和1920年物理像素高度的监测。但是,我使用缩放版本(1792 x 1120)。我创建了一个简单的网站,该站点包含高度的DIV:1120px;。在没有任何浏览器标头的情况下以全屏模式打开站点,恰好100%覆盖了我的屏幕。 AS mdn> mdn 州:
窗口接口的设备pixelratio返回的比率 物理像素分辨率分辨率为CSS像素的分辨率 当前显示设备。
因此,我查看了DevTools控制台,我看到了对我的窗口。DevicePixelRatio= 2。 现在,我想知道我的设备pixelratio是否不应该等于1920/1120而不是2?如果真的是2,那么我的本地高度分辨率应该是2240个物理像素。
I have monitor with native resolution 3072 width and 1920 height of physical pixels. However I use scaled version (1792 x 1120). I have created a simple site containing div styled with height: 1120px;. Opening site in full screen mode without any browser's headers covers my screen in exactly 100%. As MDN states:
The devicePixelRatio of Window interface returns the ratio of the
resolution in physical pixels to the resolution in CSS pixels for the
current display device.
So I looked at devTools console and I see that for me window.devicePixelRatio = 2.
And now I wonder if my devicePixelRatio shouldn't be equal 1920/1120 instead of 2? If it really is 2 then my native height resolution should be 2240 physical pixels.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论