Click to See Complete Forum and Search --> : Percentage heights not working right in IE


SeeSpotSplat
12-03-2005, 07:55 AM
Hi, Ive looked all over but can't find the solution:

I am creating a site that I want to be completely resizable, so I am not setting any absolute lengths(only percentages and relative ones). However I have hit a snag. I have an image that I want to fill a table cell completely, but when I set height="100%", the height does not change. I know the cell is larger than the image, yet it won't expand unless I define a height somewhere within my nested tables. I can't figure out a way around it without compromising the scalability of the site. Also it works fine in Firefox...

It is the stretching of a 1x1 white pixel BTW:
http://home.socal.rr.com/gampt/Portfolio/Index.html

Thanks for your time,
Artur

SeeSpotSplat
12-04-2005, 05:50 AM
Please Help!

ShrineDesigns
12-04-2005, 03:06 PM
percentage lengths for images are calculated on the image's total width and height.

example, an image is 1024 x 768, the image's height and width are both set to 75%, the rendered dimension would be resized to 800 x 600

SeeSpotSplat
12-04-2005, 03:33 PM
Are you sure, because the same thing im trying to do works for width. Infact its done with the bottom line, and all the horizontal lines in the menu. They are just 1x1 white squares stretched to 100% width. Also how come it works in FF and not IE?

This is really annoying me!

ShrineDesigns
12-04-2005, 04:00 PM
W3C says (REF (http://www.w3.org/TR/html4/struct/objects.html#adef-width-IMG))When the object is an image, it is scaled. User agents should do their best to scale an object or image to match the width and height specified by the author. Note that lengths expressed as percentages are based on the horizontal or vertical space currently available, not on the natural size of the image, object, or applet.you could try this:
CSSimg.stretch {
/* MOZ */
display: inline-block;
width: inherit;
height: inherit;
/* IE */
display: block;
width: 100%;
height: 100%;
}HTML<img class="stretch" src="path/to/image.jpg" alt="">

SeeSpotSplat
12-04-2005, 06:28 PM
Thank you for the quick reply...

I tried using the css method to stretch the image, however it did the same thing. It stretched the width, but not the height. Maybe there is a different way to position that bar with css?

Once again, I appreciate the response!

SeeSpotSplat
12-05-2005, 12:49 AM
It must be something Im doing wrong, I just can't seem to find the error.

SeeSpotSplat
12-05-2005, 12:13 PM
please help. This thing is due real soon!

SeeSpotSplat
12-06-2005, 07:25 AM
*bump*