position relative with a top indent creates unwanted white space

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
 
R

Rob ^_^

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.
 
L

lucky

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
 
L

lucky

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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top