CSS realizes full-screen adaptive display of div

http://blog.csdn.net/xn_28/article/details/50578228
http://www.cnblogs.com/zhujl/archive/2012/03/20/2408976.html
target:


<div id="main">
    <div id="nav">nav</div>
    <div id="content">content</div>
</div>



html, body {
    height: 100%;
    margin: 0px;
    padding: 0px;
}
#main {
    background-color: #999;
    height: 100%;
}
#are not {
    background-color: #85d989;
    width: 100%;
    height: 50px;
}
#content {
    background-color: #cc85d9;
    width: 100%;
    position: absolute;
    top: 50px;
    bottom: 0px;
    left: 0px;
}

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326448759&siteId=291194637