我在我的项目中使用srcset,一切都进行得很顺利,直到我在iPhone上测试,然后srcset几乎不工作,这里是我的代码:
<picture class="banner-hero__picture-container">
<source srcset="../../../../../xxx/01-480.jpg" media="(max-width: 479px)">
<source srcset="../../../../../xxx/01-768.jpg" media="(max-width: 767px)">
<source srcset="../../../../../xxx/01-1200.jpg" media="(max-width: 1199px)">
<img src="../../../../../xxx/01-1920.jpg" class="banner-hero__image">
</picture>我知道有关于像素密度的规则,但是在portait (320 is,avecreaera640 is)的iPhone上,加载的图像是1920 is,甚至不是768 is。
(在iPhone 5上测试)
发布于 2015-11-04 13:28:24
picture在WebKit中还不受支持。使用图片填充。
http://caniuse.com/#feat=picture http://scottjehl.github.io/picturefill/
https://stackoverflow.com/questions/33522763
复制相似问题