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

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 UTC