首先html結(jié)構(gòu)
<div id="main">
<div id="nav"></div>
<div id="content"></div>
</div>
然后基本的樣式
html, body {
height:100%;
margin:0px;
padding:0px;
}
#main {
background-color:#999;
height:100%;
}
#nav {
background-color:#85d989;
width:100%;
height:50px;
}
最后的重點
#content {
background-color:#cc85d9;
width:100%;
position:absolute;
top:50px;
bottom:0px;
left:0px;
}
重點就是用定位脫離標準流鳄哭,然后top和bottom一起使用,這是很反常規(guī)的用法,但是是最有效的方法,當然還有很多奇葩用法,以后的文章會一一為大家介紹踩蔚。