Forum Moderators: open

Message Too Old, No Replies

IMG height="100%" treated differently by NN/IE

Any way of getting Netscape to stretch an image to fill a table cell?

         

SilverElise

5:12 pm on Apr 6, 2002 (gmt 0)



I'm using a black 1x1 GIF to border a table cell. The tag for the vertical borders is along the lines of <IMG src="gif" height="100%" width="1">. Internet Explorer stretches the GIF to fill the entire table cell height, so regardless of the text size selected on the browser the border looks correct. In other words the 100% appears to apply to the height of the cell where the image is being rendered. In contrast in NN the GIF stays as 1x1 in other words the 100% appears to be being applied to the image size itself.

So my question is - how can I get NN to stretch the GIF to fill the cell height?

tedster

8:30 pm on Apr 6, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Percentages are not consistent across browsers, as you've discovered, so I suggest getting the same effect a different way. Create a tiling background image - a gif that is 1 x "more than you'll ever need". Only the first pixel in the image is black, and the rest are transparent.

This method gives you strong cross-browser compatibility in a simple way.