右侧(right)先加载,左侧(left)后加载其实就是右侧的写在前面,这时就不能用float了,老师想考察你们绝对定位position:absolute
.top{ height:100px; background:#ccc;}
.main{ height:500px; background:red;}
.left{ width:200px; height:500px; background:blue; position:absolute; left:0; top:100px;}
.right{ height:500px; background:green; margin-left:210px;}
.foot{ height:50px; background:#900;}
.main{ height:500px; background:red;}
.left{ width:200px; height:500px; background:blue; position:absolute; left:0; top:100px;}
.right{ height:500px; background:green; margin-left:210px;}
.foot{ height:50px; background:#900;}
.top{height:100px;background:gray;}
.main{height:500px;background:red;margin:0 auto;}
.left{width:200px;height:500px;background:blue;position:absolute;top:100px;left:0;}
.right{height:500px;background:#7D9EC0;margin:0 0 0 210px;}
.foot{height:100px;background:#FF8C00;clear:both;}
.main{height:500px;background:red;margin:0 auto;}
.left{width:200px;height:500px;background:blue;position:absolute;top:100px;left:0;}
.right{height:500px;background:#7D9EC0;margin:0 0 0 210px;}
.foot{height:100px;background:#FF8C00;clear:both;}
body{ margin:0; padding:0; font-size:30px; font-weight:bold}
div{ line-height:50px}
.left{ width:200px; height:600px; background:#ccc; float:left;}
.main{ height:600px; background:#9CF; margin-right:300px}
.right{ height:600px; width:300px; background:#FCC; position: absolute;top:0;right:0}也可以
div{ line-height:50px}
.left{ width:200px; height:600px; background:#ccc; float:left;}
.main{ height:600px; background:#9CF; margin-right:300px}
.right{ height:600px; width:300px; background:#FCC; position: absolute;top:0;right:0}也可以