三列布局:不能使用float,左右两列绝对定位,分别靠左和靠右,中间列为相对定位,左右margin分别设置为左右两列的宽度即可,如果列与列之间需要间隔,则增加相应的margin值。
.top{height:50px;background:#ccc}
.main{height: 400px;background:red;position:relative}
.left{height: 100%; width:200px;float:left;background:blue}
.right{height: 100%;float:right;position:absolute;left:210px;right:0;background:green}
.foot{height:50px;background:orange;clear:both}
.main{height: 400px;background:red;position:relative}
.left{height: 100%; width:200px;float:left;background:blue}
.right{height: 100%;float:right;position:absolute;left:210px;right:0;background:green}
.foot{height:50px;background:orange;clear:both}
已采纳回答 / 慕郎_莲华
连续写 默认是一个单词了 默认 不换行 加上 word-break: breal-all; word-wrap: break-wrod; 就自动换行了
2015-10-29
.top{width:100%;background:#ccc;}
.main{position:relative;width:100%;height:300px;}
.left{ width:200px;position:absolute;left:0;background:blue;height:300px;}
.right{width:100%;position:absolute;left:200px;right:0;background:green;height:300px;}
.foot{width:100%;background:orange;}
.main{position:relative;width:100%;height:300px;}
.left{ width:200px;position:absolute;left:0;background:blue;height:300px;}
.right{width:100%;position:absolute;left:200px;right:0;background:green;height:300px;}
.foot{width:100%;background:orange;}