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.
A:
<img src="http://..." height="100" />
No magic here, although client-side resizing usually looks crappy.
Diodeus
2009-01-29 20:02:03
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
2009-01-29 20:03:37