Responsive Images Community Group logo

We’re a group of developers working towards a markup-based means of delivering alternate image sources based on device capabilities to prevent wasted bandwidth and optimize display for both screen and print.

Join Us!
Examples of art direction. See more demos of responsive images.

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.

Sample Markup for `picture`
<picture>
  <source media="(min-width: 40em)" srcset="big.jpg 1x, big-hd.jpg 2x">
  <source srcset="small.jpg 1x, small-hd.jpg 2x">
  <img src="fallback.jpg" alt="">
</picture>
Read the picture Specification

What is the `srcset` attribute?

The srcset attribute is an extension to the existing img tag that provides some of the functionality of the picture element. It uses a more concise syntax, part of which can be used by the picture element.

Sample Markup for `srcset`
<img src="fallback.jpg" alt="" srcset="small.jpg 640w 1x, small-hd.jpg 640w 2x, med.jpg 1x, med-hd.jpg 2x ">

Read 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.

View the Use Cases and Requirements

Where can I learn more?

The RICG on GitHub
http://gh.responsiveimages.org
IRC Logs
http://ircbot.responsiveimages.org
Mailing List
http://list.responsiveimages.org

Try it now!

The members of the RICG have put together a number of demos for the picture and srcset elements. The demos on this page work in any modern browser, but if you want to see the real deal grab our Chromium build.

View the Demos

Issue Tracker

38 closed issues

Issue Description Author Last Modified
17 Some minor changes to spec anselmh 137 days ago
15 Fix the max-width extended srcset example leonderijke 152 days ago
14 Further clarify relationship to srcset marcoscaceres 154 days ago
13 Why is the type attribute of source ignored? 3 comments mtolk 170 days ago
11 Fixed sample code indentation 1 comment iandevlin 181 days ago
10 Indentation in example code not aligned properly 5 comments iandevlin 181 days ago
9 Media query evaluation in browser preloader will hurt performance 11 comments igrigorik 154 days ago
8 `<img>` fallback should not be prefetched 2 comments marcoscaceres 154 days ago
5 Fallback content - `<img>` tag 16 comments yoavweiss 154 days ago
4 Update boilerplate, copyright, and logo 1 comment marcoscaceres 208 days ago
3 Convert picture spec to use anolis 1 comment marcoscaceres 209 days ago
27 Added img states and links anselmh 137 days ago
26 Modified art-direction use-case according to @grigs' comments yoavweiss 155 days ago
25 Art direction use case description should be more than cropping 2 comments grigs 153 days ago
24 Get commitments from CG members 5 comments marcoscaceres 156 days ago
23 Find out what we need to do to go to W3C FPWD 10 comments marcoscaceres 149 days ago
22 File bugs at the W3C against individual use cases. 4 comments Wilto 174 days ago
21 XSS attack <script>console.warm('pwned')</script> 8 comments marcoscaceres 192 days ago
20 Source quality selection 11 comments marcoscaceres 192 days ago
19 File bug straight from spec 1 comment marcoscaceres 190 days ago
18 Bug link is broken 1 comment marcoscaceres 193 days ago
17 Document is not mobile friendly 3 comments marcoscaceres 197 days ago
16 Avoid download of smaller media 52 comments nwtn 148 days ago
15 Typo in first paragraph 1 comment nathanaeljones 213 days ago
14 Inform HTMLWG of progress on UC&Reqs doc 1 comment marcoscaceres 213 days ago
13 Switch to Anolis 3 comments marcoscaceres 214 days ago
12 Need better art direction diagram 18 comments marcoscaceres 191 days ago
11 Image URL sharing 14 comments nwtn 190 days ago
10 Content negotiation and CDNs 16 comments marcoscaceres 173 days ago
9 Gather usage evidence 6 comments marcoscaceres 191 days ago
8 Typos, word changes, and whatnots 6 comments webmeadow 220 days ago
7 Reach out to specific members of the community to do a review 1 comment marcoscaceres 218 days ago
6 Edited doc 3 comments dshults 224 days ago
5 David Hyatt listed as HTML5 editor? 1 comment miketaylr 225 days ago
4 Introduction Typos miketaylr 225 days ago
3 "breakpoints" undefined 6 comments miketaylr 225 days ago
2 missing `and` token in example? 2 comments miketaylr 225 days ago
1 Use Cases and Reqs document needs review 1 comment marcoscaceres 224 days ago