直接上代码吧
<body>
<div id="container" style="height:100%">
<div id="header">header</div>
<div id="main">
<div id="sidebar"><div id="category_tree_div"></div></div>
<div id="containe"><div id="cat_ads"></div></div>
<div id="clearfloat">clearfloat</div>
</div>
<div id="footer">footer</div>
</div>
</body>
css样式:
<style type="text/css">
* {
margin: 0;
padding: 0;
}
html,body {
height: 100%;
}
#header {
width: 99%;
height: 50px;
background: #06f;
}
#main {
width: 99%;
height: 100%;
}
#main #sidebar {
width: 20%;
float: left;
background: #f93;
height: 100%;
}
#main #containe {
width: 80%;
float: left;
background: #dceafc;
height: 100%;
}
#footer {
width: 99%;
height: 60px;
background: #666;
}
#clearfloat {
clear: both;
height: 1px;
overflow: hidden;
margin-top: -1px;
}
</style>