How To Resize Image Proportionally With CSS?
Posted in Help the coder! on Apr 25, 2009 at 08:39 IST (over 4 years ago). Subscribe to this post
Email
Showing comments 1 to 5 of total 5 on page 1 of 1
Post replyShowing comments 1 to 5 of total 5 on page 1 of 1
« Previous1Next »
tulippsRank: 200
Is there a way to resize (scale down) images proportionally using CSS?
Posted by tulipps on Saturday, April 25, 2009, 8:39 am
robinwoodRank: 159
You can just set a width or height property of whatever you want and the image will automatically retain its aspect ratio and appear scaled down on the webpage. You can also do this with the width and height attributes.
Hope this helps!
Posted by robinwood on Saturday, April 25, 2009, 10:30 am
lockedupRank: 213
<img style='width: 50%;' src="..." />
worked just fine for me ...
Posted by lockedup on Saturday, April 25, 2009, 4:17 pm
xtrmprgrmrRank: 7
The css properties max-width and max-height work great, but aren't supported by IE6 and I believe IE7. You would want to use this over height / width so you don't accidentally scale an image up. You would just want to limit the maximum height/width proportionately.
Posted by xtrmprgrmr on Saturday, April 25, 2009, 6:41 pm
danialah...Rank: 410
Yes, it's possible, but not in all browsers.
Check this: investigated this issue very thoroughly.
Posted by danialahchow on Saturday, April 25, 2009, 11:28 pm
Pages: « Previous1Next »