

WP百科网 http://www.wpbaike.com
第三课、DIV两列和三列的布局
1、二列自适应宽度
#side { background: #99FF99; height: 300px; width: 120px; float: left; }
#main { background: #99FFFF; height: 300px; width: 70%; margin-left: 120px; }
2、二列固定宽度
#main { background: #99FFFF; height: 300px; width: 300px; margin-left: 120px; }
3、二列固定宽度居中
<div id="content">
4、float属性
5、三列自适应宽度
6、三列固定宽度
7、三列固定宽度居中