在 srcset 属性中包含哪些分辨率才有意义? MediaWiki 使用 1.5x
和 2x
。有没有例如有哪些设备可以使用 3x
?
编辑:最后一个问题的答案 seems to be “yes” .
2015 年 10 月编辑:为了满足大多数设备的需求,图像版本尽可能少,1.5x
、2x
和 3x
似乎是要走的路
编辑 2023 年 6 月:1.5x
、2x
和 3x
似乎仍然合理。已接受答案中的设备列表已更新
最佳答案
以下是一些设备和比率的不完整列表:
1.3x Google Nexus 7 1.5x Google Nexus S Samsung Galaxy S II HTC Desire HTC Incredible S HTC Velocity HTC Sensation Nokia Lumia 900 2x iPhone 4 iPhone 4S iPhone 5 iPhone 6 iPhone 7 iPad (3rd generation) iPad 4 All Retina displays Mac Google Galaxy Nexus Google Nexus 4 Google Nexus 10 Nokia Lumia 920 Nokia Lumia 925 Samsung Galaxy S III Samsung Galaxy Note II Sony Xperia S HTC One X 2.6x Nokia Lumia 930 3x Xperia Z Xiaomi 2 Galaxy Note HTC One (M7) HTC Butterfly Samsung Galaxy S IV
这是规范的答案:
The srcset attribute is used with the src attribute, which gives the URL of the image to use for legacy user agents that do not support the srcset attribute. This leads to a question of which image to provide in the src attribute.
The answer that results in the least duplication is to provide the image suitable for an infinite width and infinite height viewport with a pixel density of 1 CSS pixel per device pixel.
引用文献
关于image - 我应该在 srcset 属性中包含哪些分辨率?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21183068/