1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

<body> does not stretch up the bottom

Discussion in 'HTML & Website Design' started by kofadije, Jun 19, 2011.

  1. #1
    Hi guys, can anyone explain why the body tag doesnt stretch to the bottom of the page. The site is http://creativedesigner.mobi
    Now if you use firebug and move the mouse over the body tag, only half the page gets highlighted, whereas if you move over <html> the whole page gets selected.

    All the <div>s are correct and Im using the 960 grid, but the body tag does stretch to accomodate some elements like the footer? why

    I realise I can use html,body{100%} (and then the body is correctly stretched) but i dont want to do this. i want to know why the height of the <body> does not auto expand to contain the footer.
    SEMrush
     
    kofadije, Jun 19, 2011 IP
    SEMrush
  2. Trix

    Trix Peon

    Messages:
    192
    Likes Received:
    1
    Best Answers:
    1
    Trophy Points:
    0
    #2
    Try adding <div style="clear:both"></div> at the last inside the "container_12" div (ie after inline-2)
     
    Trix, Jun 19, 2011 IP
  3. kofadije

    kofadije Peon

    Messages:
    40
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    you are a genius. thanks a lot. but how does clearing both help. i understand what it does, wont allow any content on both sides, but how does it affect the body and container and all???
     
    kofadije, Jun 19, 2011 IP
  4. Trix

    Trix Peon

    Messages:
    192
    Likes Received:
    1
    Best Answers:
    1
    Trophy Points:
    0
    #4
    I dont know the reason. But if floats are not cleared properly it will cause behaviours like this, and it will also sometimes not allow us to set backgrounds
     
    Trix, Jun 19, 2011 IP
  5. kofadije

    kofadije Peon

    Messages:
    40
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    well thanks a lot anyway for all your help mate!!!
     
    kofadije, Jun 21, 2011 IP
  6. BRUm

    BRUm Well-Known Member

    Messages:
    3,086
    Likes Received:
    61
    Best Answers:
    1
    Trophy Points:
    100
    #6
    Floating elements always require clear afterwards unless the following elements are also floating and you need no separation.
     
    BRUm, Jun 25, 2011 IP
    kofadije likes this.