The picture element

In its original concept, picture was designed as a parallel img element, modeled on the syntax of the HTML5 video and audio elements. The idea was to have a picture element wrapping a series of source elements, which would represent the options for the image source. It would wrap a default img element for non-supporting browsers. A media attribute on each source would hint to the browser the correct source to use:

<picture alt="original proposal"> <source src="high-resolution.png" media="min-width:1024px"> <source src="low-resolution.png"> <img src="low-resolution.png" alt="fallback image"> </picture>

For a variety of implementation-related reasons, this initial proposal was shot down. srcset filled in some of the void, ...

Get Mastering SVG now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.