tags:

views:

78

answers:

3

I want to show an image from a URL and I want that image to have a given size but I want to maintain the ratio between height and width.

+3  A: 

CSS:

IMG { width: 30%; height: auto; }

Something like this?

Mike Robinson
A: 
<img src="http://..." height="100" />

No magic here, although client-side resizing usually looks crappy.

Diodeus
A: 

you can use css to style an image

i believe if you use px for example, and specify only one dimension

img {width:100px}

the ratio is usually maintained

You can use

img {width:100px;height:auto;}

which may help

if you use

img {width:100px}

the ratio is maintained in IE 7 at least

DrG