Click to See Complete Forum and Search --> : divs taking up space


bisqui
03-10-2003, 11:56 AM
I'm attempting to place two relatively large images on top of each other in a very tight space. he images are about 200x200px and they need to fit in a table cell that's about that size. The problem I'm having is that one of the divs the images are in is occupying a 200x200px space below where I have the images actually placed. Ok, that's a terrible description. Let me try to say that another way. The first div with the image in it is placed perfectly. By default, the second div gets placed below it. I have to set the 'top' property to -200px to get the second image placed on top. The problem is, the second div element still reserves the space below the first div even though I've moved it up 200px. Is there any way to get around this so I can fit both elements on top of each other in such a tight space? I tried making them inline divs, but the problem shifts to a horzontal one instead of a vertical one. I may be able to get away with that in the design, but NS6+ crops the images in this case no matter how I set the height and width values of either the div or images. Has anybody else run across this annoying feature?

gil davis
03-10-2003, 12:29 PM
Try this:<table border>
<tr>
<td style="position: relative">
<img src="lilguy2.gif" height=200 width=200>
<div id="d2" style="position: absolute; top: 0px; left: 0px"><img src="cancel.gif" height=200 width=200></div>
</td>
</tr>
</table>

bisqui
03-10-2003, 12:39 PM
I was just about to post, you beat me to it. I actually fixed the problem by placing one image directly in the table cell and another in an absolute div outside of the table. Looks like it works in all browsers. Thanks for the help!