position relative with a top indent creates unwanted white space

  • Thread starter Thread starter lucky
  • Start date Start date
L

lucky

Hi

I have some DIV tags in my page and I set their positioning using the
position: relative; and top: -200; attributes.
This gives me white spaces at the end of my document at the place where
the content of the <div> tags would be if they were in the regular
place.

Does anyone know how to get rid of this white spaces?

Thanks
 
Hi Lucky,

What are you trying to achieve? a page footer in the last cell of a table?
What is the div's container? A table cell?

ie. <td>&nbsp;<div style="position:relative;top:-200">My page
footer</div></td>

if so remove the &nbsp; from the cell contents, this will shrink the table
cell height to 0 or set the table cell height to 0px. Check you code in
other browsers (I think they will size the table cell without the &nbsp;)

Regards.
 
Hi Rob,

I need to display a table containing images and then when I have
finished it, I need to create another table above the first one (not
below)

So when I create the second table I use a DIV tag with a top attribute
set to some negative valur (ie -200). It works fine except that it adds
extra white space at the bottom of my page, where the DIV tag content
would be if I hadn't use any TOP attribute.


<DIV id=1>
<img src=img1.gif height=200>
</DIV>

<DIV id=2 style="position: relative; top: -200;">
<img src=img2.gif>
</div>

Gives me img1 with img2 above it (which is what I want) and some white
space below them (which I want to get rid of)

Thanks to whoever can help

Lucky
 
Didn't work. Still having extra white spaces.
Apologies about not being in the right place.
 
Back
Top