View Full Version : Resize "img" tag to 100%

Apr 3rd, 2007, 10:05 PM
Hi there,

I need to rescale an image so that it occupies 100% of the table cell it's in. Actually, it's just a PNG pic with 1px height, but it's a gradient that I want to expand with the page content, and it needs to be inside an image tag for it to work with a JavaScript code - since it's a transparent PNG and I want it to work with IE.

I tried to address the tag to a class that defines 100% height, with absolute and relative positioning, with no success. Also, giving the image an attribute of 100% height, inside the tag, seems not to work.

Thanks a lot, guys!

Apr 4th, 2007, 01:51 AM
Iím not entirely sure but I think the parent element needs a size too, in order to make the percent size of a child element work.