Make body have 100% of the browser height

Try setting the height of the html element to 100% as well.

html, body
{
    height: 100%;
}

Body looks to its parent (HTML) for how to scale the dynamic property, so the HTML element needs to have it's height set as well.

However the content of body will probably need to change dynamically. Setting min-height to 100% will accomplish this goal.

html{
  height: 100%;
}
body {
  min-height: 100%;
}

 

from:http://stackoverflow.com/questions/6654958/make-body-have-100-of-the-browser-height

posted @ 2014-04-17 11:17  sunnyboy  阅读(150)  评论(0编辑  收藏  举报