1

我在理解如何使用Picturefill实现视网膜图像时遇到了一些麻烦

这就是我所拥有的......而且我认为它不起作用:

<picture>
    <img
    src="img/small.jpg"
    srcet=
    "img/large.jpg" data-media="(min-width: 800px) 900w"
    "img/large.jpg" data-media="(min-width: 800px) and (min-device-pixel-ratio: 1.5) 1800w"
    "img/medium.jpg" data-media="(min-width: 640px) 640w"
    "img/medium_2x.jpg" data-media="(min-width: 640px) and (min-device-pixel-ratio: 1.5) 1280w"
    "img/medium.jpg" data-media="(min-width: 320px) 320w"
    "img/medium_2x.jpg" data-media="(min-width: 320px) and (min-device-pixel-ratio: 1.5) 640w"
    size="100%"
    alt="">
</picture>

media-queires 拉出 2 倍大的图像。对于 Android 设备,将其设置为 1.5。

4

0 回答 0