W3C home > Mailing lists > Public > www-style@w3.org > February 2002

RE: Image proportional scaling?

From: Manos Batsis <m.batsis@bsnet.gr>
Date: Thu, 7 Feb 2002 10:32:18 +0200
Message-ID: <E657D8576967CF448D6AF22CB42DD2690FF1FC@ermhs.Athens.BrokerSystems.gr>
To: "Einar Westermann" <einar.westermann@online.no>
Cc: <www-style@w3.org>


> -----Original Message-----
> From: Einar Westermann [mailto:einar.westermann@online.no] 

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

Pardon me but I cannot understand the reason for presenting your query
like that. Why not give a value relative to the container value (in %)?
If you know the normal dimensions of the image, you can give those to
the image container instead; then use percentage values as dimensions
for the image.

Suppose you have a 100*50px image:

<div style="width:100px;height:50px;">
 <img src="myImage.png" style="width:50%;height:50%;"/>
</div>

That will give you the image in half of the original size.
But I'm sure you probably need a more dynamic solution; could rephrase
your query to show the problem leading you in this?

Kindest regards,

Manos
Received on Thursday, 7 February 2002 03:29:19 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 27 April 2009 13:54:13 GMT