What is the `picture` Element?
The picture
element is a markup pattern that allows developers to declare multiple sources for
an image. By using media queries, it gives developers control as to when and if those
images are presented to the user.
The picture
element is one part of the new picture specification.
What are the `srcset` and `sizes` attributes?
The srcset
and sizes
attributes extend the img
and source
elements to provide a list of available image sources and their sizes. Browsers can then use this information to pick the best image source.
Both srcset
and sizes
are part of the picture specification and can used separately or in conjunction with the picture
element.
Picture relationship to srcset
The srcset
Specification
Example srcset
Parser
What are the use cases for each?
The Use Cases and Requirements document outlines the goals, objectives, and potential issues
for end users that must be solved by the picture
and srcset
extension specifications.
Where can I learn more?
- The RICG on GitHub
- http://gh.responsiveimages.org
- IRC Logs
- http://ircbot.responsiveimages.org
- Discussion List Archives
- http://list.responsiveimages.org
News / Updates
Tweets by @respimgImplementation status
This list indicates the status of implementation in major browser engines. We always try to keep this up-to-date but please refer to the linked issues for the latest status.
In most bugtrackers you can vote for implementation in the linked bugs.
- Blink / Chrome
- Picture: ASSIGNED (targeted for Chrome 38)
- srcset: IMPLEMENTED/SHIPPED (Chrome 34)
- WebKit / Safari
- Picture: UNCONFIRMED (not implemented)
- srcset: IMPLEMENTED
- Mozilla Firefox
- Picture: ASSIGNED (soon in Nightly)
- srcset: ASSIGNED (soon in Nightly)
- Microsoft Internet Explorer
- Picture: UNDER CONSIDERATION
- srcset: UNDER CONSIDERATION