.top{ width:auto;height:50px; background:gray;}
.main{width:auto;height:300px;background:red;}
.left{ height:300px; width:200px;background:blue}
.right{ height:300px;background:#6F0;position:absolute; margin-left:210px; width:100%;}
.foot{ height:50px; background:orange;}
</style>
答案应该是这个,不过
.main{width:auto;height:300px;background:red;}
.left{ height:300px; width:200px;background:blue}
.right{ height:300px;background:#6F0;position:absolute; margin-left:210px; width:100%;}
.foot{ height:50px; background:orange;}
</style>
答案应该是这个,不过
.top{height:50px;margin:0 auto;background:#ccc;}
.main{height:600px;background:red;}
.left{width:200px;height:600px; position:absolute;left:0;top:50px;background:blue;}
.right{height:600px;margin:0 0 0 210px ;background:green;}
.foot{height:50px;margin:0 auto;background:#f63;}
.main{height:600px;background:red;}
.left{width:200px;height:600px; position:absolute;left:0;top:50px;background:blue;}
.right{height:600px;margin:0 0 0 210px ;background:green;}
.foot{height:50px;margin:0 auto;background:#f63;}
.top{height:30px;width:100%;background:#ccc;}
.foot{height:30px;background:green}
.main{height:300px;width:100%;background:red;position:relative;overflow:hidden}
.left{width:200px;height:300px;background:blue}
.right{height:300px;background:green;position:absolute;left:210px;top:0px;width:100%}
.foot{height:30px;background:green}
.main{height:300px;width:100%;background:red;position:relative;overflow:hidden}
.left{width:200px;height:300px;background:blue}
.right{height:300px;background:green;position:absolute;left:210px;top:0px;width:100%}
.top{width:100%;height:50px;background:gray;}
.main{width:100%;height:300px;background:red;}
.left{width:30%;height:300px;background:blue;float:left;}
.right{width:68%;height:300px;background:green;float:right;}
.foot{width:100%;height:30px;background:orange;clear:both;}
.main{width:100%;height:300px;background:red;}
.left{width:30%;height:300px;background:blue;float:left;}
.right{width:68%;height:300px;background:green;float:right;}
.foot{width:100%;height:30px;background:orange;clear:both;}
因为main包含的块全都设置了浮动,而浮动和绝对定位会使块脱离标准文档流,但是head仍在文档流中 所以foot会忽略main的所有块而贴着head块
方法1: .main{
width:860px;height:600px;margin:0 auto;background:#9FC;}
方法2:.footer{ height:50px; background:#9F9; margin:600px 0 0 0;}
方法3:.footer{width:100%; height:50px; background:#9F9; position:absolute;top:700px;}
方法1: .main{
width:860px;height:600px;margin:0 auto;background:#9FC;}
方法2:.footer{ height:50px; background:#9F9; margin:600px 0 0 0;}
方法3:.footer{width:100%; height:50px; background:#9F9; position:absolute;top:700px;}