I have the following laravel
code:
<img sizes="(min-width:600px)100vw, (max-width:601px)100vw"
srcset="{{ asset('assets/img/img-home-experiences-600x600.jpg') }} 600w, {{ asset('assets/img/img-home-experiences-410x620.jpg') }} 601w" class="img-responsive" />
What I'm trying to do is to display the 600x600 image for width < 600px, and the 410x620 for width > 600px.
The code above works on desktop. But on a iPhone (iOS 8.1.2, safari/chrome), it displays the 410x620 image instead. It works properly (both desktop and mobile) without Picturefill included, except IE9 - IE11.
Is there something I'm missing here?
Solution:
<picture>
<!--[if IE 9]><video style="display: none;"><![endif]-->
<source srcset="{{ asset('assets/img/img-home-experiences-600x600.jpg') }}" media="(max-width: 600px)">
<source srcset="{{ asset('assets/img/img-home-experiences-410x620.jpg') }}" media="(min-width: 601px)">
<!--[if IE 9]></video><![endif]-->
<img sizes="100vw" srcset="{{ asset('assets/img/img-home-experiences-600x600.jpg') }} 600w, {{ asset('assets/img/img-home-experiences-410x620.jpg') }} 601w" class="img-responsive" />
</picture>