我需要使用<img>
而不是<picture>
来为视口尺寸和设备像素比率提供不同的图像尺寸。
示例(代码无效):
<img srcset="store/img-200.jpg 180w,store/img-200.jpg 180w 2x">
有没有解决方法?
我停止添加更多视口变量。
<img srcset="https://myserver.com/image?w=800&h=400 800w,https://myserver.com/image?w=1200&h=600 1200w,https://myserver.com/image?w=1600&h=800 1600w,https://myserver.com/image?w=2000&h=1000 2000w,https://myserver.com/image?w=2400&h=1200 2400w,https://myserver.com/image?w=2800&h=1400 2800w,https://myserver.com/image?w=3200&h=1600 3200w"
sizes="100vw">
浏览器将下载图像进行多种配置: