I am trying to implement art direction and make the <picture>
element show a square image on mobile and a landscape image on all other devices. For some reason, Safari keeps falling back to the <img>
tag, when it should be able to recognize the <source srcset="">
values I've given here.
<picture>
<source media="(max-width: 480px)" srcset="http://placehold.it/480x480">
<source media="(max-width: 640px)" srcset="http://placehold.it/640x320">
<source media="(max-width: 1024px)" srcset="http://placehold.it/1024x600">
<img src="http://placehold.it/1224x1224/c00/fff" alt="">
</picture>
This seems to work find in chrome, but can anyone explain why Safari is ignoring these srcset attributes and how I can get it to work in Safari 9? Thanks!