W3C home > Mailing lists > Public > whatwg@whatwg.org > May 2012

Re: [whatwg] Implementation complexity with elements vs an attribute (responsive images)

From: Benjamin Hawkes-Lewis <bhawkeslewis@googlemail.com>
Date: Sun, 13 May 2012 21:17:06 +0100
Message-ID: <CAEhSh3cnJG8i1bC9QRHTEkdv7f1RJO1KPbF=9-AitPBNnyX89w@mail.gmail.com>
To: Bjartur Thorlacius <svartman95@gmail.com>
Cc: whatwg@lists.whatwg.org
On Sun, May 13, 2012 at 8:55 PM, Bjartur Thorlacius
<svartman95@gmail.com> wrote:
> But the chosen image resolution might be a factor for choosing layout.

Maybe we should think of a way to expose _that_ information to CSS,
rather than going in the other direction.

  <img src="a.jpg" alt=""
       set="a.jpg 600x200 1x,
               b.jpg 600x200 2x,
               c.jpg 200x200">

section { /* generic style rules */ }
section! img:intrinsic-aspect-ratio(<2) { /* specific overrides for
section when the UA picks the narrow image */ }

Benjamin Hawkes-Lewis
Received on Sunday, 13 May 2012 20:17:55 UTC

This archive was generated by hypermail 2.3.1 : Monday, 13 April 2015 23:09:13 UTC