gpt4 book ai didi

html - 为什么响应式网页设计在具有相同分辨率但不同 ppi 的屏幕上响应不同?

转载 作者:行者123 更新时间:2023-11-28 18:10:27 35 4
gpt4 key购买 nike

当使用媒体查询时,您可以设置 min-width 属性并进行相应的设计,但我正在使用我的台式机和手机进行测试。我的手机分辨率为 1080p,与我的桌面显示器相同,但设计在两个屏幕上的响应不同。它应该表现得一样,不是吗?我错过了什么?如果我只使用像素,为什么它们的行为会有所不同?

最佳答案

所以事实证明,CSS 像素 不同于硬件像素

CSS 规范说:

If the pixel density of the output device is very different from that of a typical computer display, the user agent should rescale pixel values. It is recommended that the pixel unit refer to the whole number of device pixels that best approximates the reference pixel. It is recommended that the reference pixel be the visual angle of one pixel on a device with a pixel density of 96dpi and a distance from the reader of an arm's length.

这是一本好书: http://www.quirksmode.org/blog/archives/2010/04/a_pixel_is_not.html

关于html - 为什么响应式网页设计在具有相同分辨率但不同 ppi 的屏幕上响应不同?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18776392/

35 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com