3 ms·
I just learned about this, but srcset seems better than <picture> for backwards compatibility reasons. To make images on the ipad3 look great, all we have to d
by jcampbell1 14y ago
I just learned about this, but srcset seems better than <picture> for backwards compatibility reasons.
To make images on the ipad3 look great, all we have to do is
change:
<img src="photo.jpg" width=800 height=600 />
to:
<img src="photo.jpg" srcset="photo@2x.jpg 1600w 1200h" width=800 height=600 />
That is a ton cleaner than dealing with <picture> which completely breaks most browsers.
- bsatrom 14y agoI agree that srcset has its advantages, and like I said in the post, I expect that it will make a fine solution in the long-run, and I'm glad this problem is being addressed. One minor point, however, is that the strawman <picture> proposal was meant to be equally backward compatible through the use of a child <img> tag that would only display in unsupported browsers, as <video> works today: <picture alt="cool-image"> <source src=hires.png media="max-width:1920px"> <source src=midres.png media="min-width:800px"> <source src=lores.png> <!-- fallback for browsers without support --> <img src=midres.png alt="cool-image"> </picture>
- jcampbell1 14y agoThat is not nearly as backwards compatible because you are adding markup. Will the picture element inherit it's style from the inner img element? I don't think so. Now you have to go mess around with the CSS and have two different pathways for the style to be applied based on the browser. Also, <video> fallback doesn't really work. If you have an h264 video, there is no good way to make it play in all browsers with markup alone (Firefox won't fallback to flash).
- bsatrom 14y agoI don't disagree at all. Like I said in the post, srcset will one day make a fine solution and given the right input, might even end up being developer-friendly. I hope that ends up being the case, because the current syntax is cryptic and vague.