不用浮动,用定位方式。
right先加载,代码中right在前。
.top{height:100px; background:#ccc;}
.main{position:relative; background:red;}
.left{position:absolute; top:0; width:200px; height:500px; background:blue;}
.right{margin-left:210px; height:500px; background:#9C9;}
.foot{height:50px; background:#F63;}
right先加载,代码中right在前。
.top{height:100px; background:#ccc;}
.main{position:relative; background:red;}
.left{position:absolute; top:0; width:200px; height:500px; background:blue;}
.right{margin-left:210px; height:500px; background:#9C9;}
.foot{height:50px; background:#F63;}
.top{background:red;height:50px;}定义头部
.main{height:600px; background:green;position:relative;}给爸爸一个框
.left{ width:200px;background:blue;height:600px;float:left;position:absolute;top:0;left:0;}修改大儿子
.right{height:600px; background:yellow;margin-left:210px;}修改二儿子
.foot{background:red; height:50px;}
.main{height:600px; background:green;position:relative;}给爸爸一个框
.left{ width:200px;background:blue;height:600px;float:left;position:absolute;top:0;left:0;}修改大儿子
.right{height:600px; background:yellow;margin-left:210px;}修改二儿子
.foot{background:red; height:50px;}
.left{ width:33%; height:600px; background:#ccc; position:absolute; left:0; top:0}
.main{ max-height:600px;margin:-30px 33% 0 33%; background:lightblue}
.right{ height:600px; width:33%; position:absolute; top:0; right:0; background:pink;}
.main{ max-height:600px;margin:-30px 33% 0 33%; background:lightblue}
.right{ height:600px; width:33%; position:absolute; top:0; right:0; background:pink;}
.top{background:#ccc;height:100px;}
.main{width:550x;height:500px;background:red;position: relative;}
.left{width:200px;height:500px; background:blue;position: absolute;top: 0;left: 0;}
.right{margin-left:210px; height:500px; background:#9c9;}
.foot{height:50px;background:#f63;}
.main{width:550x;height:500px;background:red;position: relative;}
.left{width:200px;height:500px; background:blue;position: absolute;top: 0;left: 0;}
.right{margin-left:210px; height:500px; background:#9c9;}
.foot{height:50px;background:#f63;}
.top{height:100px;background:#CCC;}
.main{background:red;height:300px;position:relative;}
.left{width:200px;height:300px;background:blue;position:absolute;left:0;top:0;}
.right{height:300px;background:#0F9;margin-left:220px}
.foot{height:50px;background:#F51;}
.main{background:red;height:300px;position:relative;}
.left{width:200px;height:300px;background:blue;position:absolute;left:0;top:0;}
.right{height:300px;background:#0F9;margin-left:220px}
.foot{height:50px;background:#F51;}
.top{height:100px;width:100%;background:gray;}
.main{height:500px;width:100%;background:red;position:relative;}
.left{height:100%;width:200px;background:blue;position:absolute;top:0;}
.right{height:100%;margin-left:210px;background:green;}
.foot{height:100px;width:100%;background:orange;}
绝对定位真难玩
.main{height:500px;width:100%;background:red;position:relative;}
.left{height:100%;width:200px;background:blue;position:absolute;top:0;}
.right{height:100%;margin-left:210px;background:green;}
.foot{height:100px;width:100%;background:orange;}
绝对定位真难玩