[英]srcset doesn't work on iPhone
我在我的項目上使用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>
我知道有關於像素密度的規則,但是在iPhone上的肖像(320像素,視網膜640像素)中,加載的圖像是1920像素,甚至不是768像素。
(在iPhone 5上測試)
WebKit尚不支持picture
。 使用圖片填充。
http://caniuse.com/#feat=picture http://scottjehl.github.io/picturefill/
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.