Re: Image proportional scaling?

Hello Håkon,

Thursday, February 07, 2002 you wrote:

HWL> Also sprach Einar Westermann:

HWL>  > Is there no way in CSS to scale an image both proportionally and within a 
HWL>  > containing block by a percentage of its intrinsic dimensions?

HWL> No, there isn't. It's a good idea, though. How about:

HWL>  IMG { width: 1.5 }

I wonder how that works in existing browsers...
Aha, in Quirks mode this value gets interpreted as pixels, in
Standards mode it gets ignored. And Opera 6 always uses Quirks.

HWL> The other one is setting font sizes based on the width of the
HWL> containting block. I.e., when you resize the window the font size
HWL> changes. This one is trickier to come up with a syntax for. We could
HWL> have used % since everything you can do with % can also be achieved
HWL> with "em". I.e., these two are equivalent:

HWL>  P { font-size: 1.5em }
HWL>  P { font-size: 150% }

HWL> We could redefine %, but that would break existing pages.. A factor
HWL> could be used instead, e.g.

HWL>  P { font-size: 0.05 }

I read somewhere that the rationale for not using percentages related
to the container for fonts, was that the percentages would become
really small. If you use factors, the values whould be even smaller :)



 Rijk                            mailto:rijk@iname.com

Mot du Jour:
Cannot open file "C:\Communicatie\Sigs\KookieJar\wisdom.txt"

Received on Thursday, 7 February 2002 05:44:50 UTC