How to Shrink image size when browser size is reduced

B

Bob Richardson

Is it possible for an image to SHRINK (both height and width, keeping same
h/w ratio) when the browser's width is reduced? It's easy to have both h & w
increase, as needed, to fill up 100% of the <td>, but I don't see how to
have the image shrink.

Without JavaScript, the standard seems to be scrollbars when the browser
shrinks. I'd like the picture to shrink in size and avoid the scrollbars.
 
R

Randy Webb

Bob said:
Is it possible for an image to SHRINK (both height and width, keeping same
h/w ratio) when the browser's width is reduced? It's easy to have both h & w
increase, as needed, to fill up 100% of the <td>, but I don't see how to
have the image shrink.

Percentages my friend, percentages.
Without JavaScript, the standard seems to be scrollbars when the browser
shrinks.

Only for those that know no better, and that may indeed include me.
I'd like the picture to shrink in size and avoid the scrollbars.

And what exactly does this have to do with Javascript?

<img src="someImage.gif" width="100%">
 
B

Bob Richardson

Randy Webb said:
Percentages my friend, percentages.


Only for those that know no better, and that may indeed include me.


And what exactly does this have to do with Javascript?

<img src="someImage.gif" width="100%">

The above is exactly how I've coded the HTML. I think the IMG is 700 pixels
wide. When you expand the size of your browser beyond 700, the picture's
width and height both expand. But when the browser's width is less than 700,
the picture does not shrink. Just scroll bars.

Thus, I thought that perhaps a JavaScript function might work to reduce the
size of the image.
 
B

Bob Richardson

Bob Richardson said:
The above is exactly how I've coded the HTML. I think the IMG is 700
pixels wide. When you expand the size of your browser beyond 700, the
picture's width and height both expand. But when the browser's width is
less than 700, the picture does not shrink. Just scroll bars.

Thus, I thought that perhaps a JavaScript function might work to reduce
the size of the image.

Ah, I see that it shrinks nicely in Firefox, but not IE 6 :(
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,900
Latest member
Nell636132

Latest Threads

Top