Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS problem with the bottom of my site Re: problem with the bottom of my site

#54275

So you’re a fan of position:relative eh? Here’s the thing with position:relative – it allows you to move elements in the page relative to where they would have been if no positioning was specified. So when you specify { postition:relative; top:-100px; } the element will appear 100 pixels above where it would have appeared with no positioning.

That’s great, but how does the browser know where it would have appeared in the first place? The answer is it reserves space on the page for the element. Then it applies your relative positioning, leaving the ‘reserved’ space empty. You never get that reserved space back, so it appears in your page as a blank area under the content.

This is only true for position:relative, not for other positioning techinques. If you use position:absolute for example you can acheive the effect you are looking for. Another option is to use negative margin instead of relative positioning to move elements up the page.

#side_comment {
color:#FFFFFF;
font-size:60px;
left:725px;
position:absolute;
top:420px;
width:250px;
}