Forum Moderators: open

Message Too Old, No Replies

Resizing images using a percentage

Browser support?

         

limbo

2:08 pm on Oct 10, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I have an image i'd like to expand and contract to a users resolution and wondererd how many browsers support this capability?

eg

<img source="pic.gif" width="100%" height="50">

I know i will lose quality in the image as it contracts and expands but it is of a seascape and the changes (up to 1152x864) are remarkably good. I have only tested it IE5.5 and wondered if I should be using this attribute value in this way?

Ta

Limbo

choster

2:40 pm on Oct 10, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



It may be safer to use CSS, see [webmasterworld.com...] , or www.bigbaer.com/css_tutorials/css.scale.image.html.tutorial.htm for a more complete treatment, or www.brainjar.com/css/cards/default3.asp for a novel example.

jomaxx

4:36 pm on Oct 10, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I can't comment on the % question specifically, but if you're going to adjust the width but not the height, I strongly suggest you test the effect on an extremely wide range of platforms, screen resolutions and window sizes.

Webshots has a "fit to window" function for the images it hosts. You might benefit from looking at their code.

limbo

4:56 pm on Oct 10, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Thanks for the replies.

Choster - I get the idea with the Papabaer tut. Looks good. I would use this if the Img% percentage does not work, as it's only for one page, and really needn't be CSS. Also I am still hoping to find out about whether % is fully supported? Opera? Netscape? Mozilla?

Jomaxx - thanks for the good advice. I had thought this might end up causing more problems than it solved.

Maybe I'll fade the image into a table background colour instead?

I have a few tests yet before I ditch the idea.

Ta

Limbo