treehouse : what would you like to learn today?
Web Design Web Development iOS Development

100% height again

  • Hi all,

    I didn't use to have any problems with this but now I do, can't make it work in anything but IE7 - the irony!

    html, body { height: 100%;}
    .container {height:auto !important; height:100%; min-height:100%; }
    .container .box { height: 100%;}

    The .container works just fine it seems but I can't get the .box to get it as well. What am I missing?


    Thanks a lot,
    Oskar
  • Hm, just found this:

    div { min-height: 100% }

    and two nested divs <body> <div><div> </div></div> </body>

    The result is that inner div is not 100% of body.

    The reason is because 'height' is not explicitly defined for the outer div, so the percentage in the inner is calculated to 'auto'.

    Which actually makes sense. Guess I need to rethink my html-layout.