3 ms·
The <picture> tag provides a nice, no-JS <img> tag upgrade that works in browsers (it doesn't break in IE so long as you have an <img> in there) to deliver the
by onion2k 7y ago
The <picture> tag provides a nice, no-JS <img> tag upgrade that works in browsers (it doesn't break in IE so long as you have an <img> in there) to deliver the right image to the user. That means the user gets a smaller download, faster to render, higher quality image. It's essentially progressive enhancement for images (everyone gets the JPG or PNG, some users get a better format if they can handle it).
You can even add media queries to the <source> tags to deliver different images based on the user's device.
There is literally no downside to using it.