{"id":248,"date":"2012-05-19T16:04:24","date_gmt":"2012-05-19T16:04:24","guid":{"rendered":"http:\/\/www.w3.org\/community\/respimg\/?p=248"},"modified":"2012-05-19T16:27:51","modified_gmt":"2012-05-19T16:27:51","slug":"an-update-on-responsive-images","status":"publish","type":"post","link":"https:\/\/www.w3.org\/community\/respimg\/2012\/05\/19\/an-update-on-responsive-images\/","title":{"rendered":"An update on responsive images"},"content":{"rendered":"<p>Hey everyone,<\/p>\n<p>I guess a lot of you guys aren&#8217;t signed up to the whatwg mailing list so I thought it&#8217;d be good to give an update on what&#8217;s going on. I don&#8217;t claim to be an authority, in fact I&#8217;m sure my knowledge is flawed; Also things are moving so fast that any information here might be plain wrong by the time you read it! (please leave a comment if you see an error)<\/p>\n<p><strong>How srcset really works (-ish!)<br \/>\n<\/strong>When an image tag reads &lt;img src=&#8221;mobile.jpg&#8221; alt=&#8221;&#8221; srcset=&#8221;medium.jpg 600w, desktop.jpg 1000w&#8221;&gt; what this means is: default to mobile.jpg, unless <strong>the viewport width<\/strong> is greater* than 600px then the browser is free to choose mobile.jpg or medium.jpg as it sees fit. Once the viewport width is greater than 1000px the browser is free to choose any of the three images.<strong><\/strong><\/p>\n<p>For a much better explanation read Bruce Lawson&#8217;s great <a href=\"http:\/\/html5doctor.com\/html5-adaptive-images-end-of-round-one\/\" target=\"_blank\" rel=\"nofollow\">html5doctors post<\/a><strong><br \/>\n<\/strong><\/p>\n<p><strong>Tab&#8217;s suggestion<br \/>\n<\/strong>On the mailing list Tab Atkins (&amp; others) suggested the <a href=\"http:\/\/lists.whatwg.org\/htdig.cgi\/whatwg-whatwg.org\/2012-May\/035962.html\" target=\"_blank\" rel=\"nofollow\">following CSS like notation might be more helpful<\/a>:<br \/>\n&lt;img src=&#8221;mobile.jpg&#8221; alt=&#8221;&#8221; srcset=&#8221;medium.jpg min-width:600px, desktop.jpg min-width:1000px&#8221;&gt;<br \/>\nAnd the browser would be free to choose <strong>any<\/strong> image where it&#8217;s corresponding media query is satisfied (this is different to &lt;picture&gt; where the browser gets no choice). Also only a subset of media queries would be allowed (min-width, max-width and maybe min-pixel-density). This is more friendly to developers that know CSS, it&#8217;s more readable and allows for units other that px to be used. On the downside it&#8217;s slightly more verbose.<\/p>\n<p><strong>Going forward<br \/>\n<\/strong>I&#8217;d suggest you all <a href=\"http:\/\/www.whatwg.org\/mailing-list\" target=\"_blank\" rel=\"nofollow\">join up to the mailing list<\/a>, but if you don&#8217;t want to receive dozens of emails a day, feel free to leave comments\/thoughts below.<strong><br \/>\n<\/strong><\/p>\n<p>* there is discussion whether &#8220;600w&#8221; should reference the maximum viewport or minimum viewport, however for the sake of brevity I&#8217;m going to just to talk about minimum.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Hey everyone, I guess a lot of you guys aren&#8217;t signed up to the whatwg mailing list so I thought it&#8217;d be good to give an update on what&#8217;s going on. I don&#8217;t claim to be an authority, in fact &hellip; <a href=\"https:\/\/www.w3.org\/community\/respimg\/2012\/05\/19\/an-update-on-responsive-images\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1747,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_s2mail":"yes","footnotes":""},"categories":[1],"tags":[],"class_list":["post-248","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/www.w3.org\/community\/respimg\/wp-json\/wp\/v2\/posts\/248","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.w3.org\/community\/respimg\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.w3.org\/community\/respimg\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.w3.org\/community\/respimg\/wp-json\/wp\/v2\/users\/1747"}],"replies":[{"embeddable":true,"href":"https:\/\/www.w3.org\/community\/respimg\/wp-json\/wp\/v2\/comments?post=248"}],"version-history":[{"count":6,"href":"https:\/\/www.w3.org\/community\/respimg\/wp-json\/wp\/v2\/posts\/248\/revisions"}],"predecessor-version":[{"id":254,"href":"https:\/\/www.w3.org\/community\/respimg\/wp-json\/wp\/v2\/posts\/248\/revisions\/254"}],"wp:attachment":[{"href":"https:\/\/www.w3.org\/community\/respimg\/wp-json\/wp\/v2\/media?parent=248"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.w3.org\/community\/respimg\/wp-json\/wp\/v2\/categories?post=248"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.w3.org\/community\/respimg\/wp-json\/wp\/v2\/tags?post=248"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}