W3C home > Mailing lists > Public > www-style@w3.org > January 2009

Re: [css3-values] new editor's draft (and [css3-box])

From: Robert O'Callahan <robert@ocallahan.org>
Date: Tue, 20 Jan 2009 11:36:40 +1300
Message-ID: <11e306600901191436x1559adf2ge527cc13e02c7589@mail.gmail.com>
To: "Alex Mogilevsky" <alexmog@microsoft.com>
Cc: "David Hyatt" <hyatt@apple.com>, "Håkon Wium Lie" <howcome@opera.com>, "Christoph Päper" <christoph.paeper@crissov.de>, "www-style@w3.org" <www-style@w3.org>
On Tue, Jan 20, 2009 at 11:15 AM, Alex Mogilevsky <alexmog@microsoft.com>wrote:

>  "device-pixel-ratio" would be one of the ways to make it work (although
> setting sizes will be tricky and involve fractional pixels). Not sure if
> it's better than simply letting people use device pixels, since it makes it
> possible anyway.
>
>
I think for your use-case it's actually significantly easier to use
device-pixel-ratio.

.image { background-image: url(1x.jpg); background-size:100%; width: Wpx;
height: Hpx; }
@media (min-device-pixel-ratio: 1.5) { .image { background-image:
url(2x.jpg); } }
@media (min-device-pixel-ratio: 2.5) { .image { background-image:
url(3x.jpg); } }

Adding more image sizes is easy (whether you use fractional scalings or not)
and you can be sure that the extra rules won't break your layout (or
zooming), even if you get something wrong, because the image width and
height remain specified in one place.

Rob
-- 
"He was pierced for our transgressions, he was crushed for our iniquities;
the punishment that brought us peace was upon him, and by his wounds we are
healed. We all, like sheep, have gone astray, each of us has turned to his
own way; and the LORD has laid on him the iniquity of us all." [Isaiah
53:5-6]
Received on Monday, 19 January 2009 22:37:26 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:20:15 GMT