Treehouse: Grow your CSS skills. Land your dream job.

problem with the bottom of my site

  • # February 24, 2009 at 12:30 pm

    i’ve been working on a site for a local artist and been happy with what i’ve been doing but for some reason just below the black box at the bottom of the site theres a large area under it doesn anyone know how to get rid of this at all? and i don’t want to have the background have a certain height i want it to get bigger if more info is added to it can anyone help?

    # February 24, 2009 at 12:58 pm

    does your css validate?

    I am looking at your code, and you have made spelling mistakes.

    also I am trying to see why you made it so big

    # February 24, 2009 at 1:28 pm

    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 {

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.