.top{ height:60px; background:#B0A6A6}
.main{ margin:0 auto; position:relative; background:#E12C2F}
.left{ width:200px; height:600px; background:#2533D4; position:absolute; top:0}
.right{ height:600px; background:#20977B; margin-left:210px}
.foot{ height:40px; background:#E8611B}
.main{ margin:0 auto; position:relative; background:#E12C2F}
.left{ width:200px; height:600px; background:#2533D4; position:absolute; top:0}
.right{ height:600px; background:#20977B; margin-left:210px}
.foot{ height:40px; background:#E8611B}
最新回答 / 孩纸╭别伤xin、了
可能你还想问,那只要有一个position:absolute就可以了,剩下来的就直接left:0;right:0就可以了。但是电脑没有人脑好使,它们要一步步来,要先发出“是否要在固定的位置?”如果要,再发出“在哪个位置?”
2016-06-07
正确答案:
.main{width:100%; height: 600px; position: relative;}
.left{width:200px; height:600px;background: blue;position:absolute; top:0; left:0;}
.right{height: 600px;background:green;margin:0 0 0 200px;margin-left:200px;}
.foot{width: 100%; height: 100px; background: orange;}
.main{width:100%; height: 600px; position: relative;}
.left{width:200px; height:600px;background: blue;position:absolute; top:0; left:0;}
.right{height: 600px;background:green;margin:0 0 0 200px;margin-left:200px;}
.foot{width: 100%; height: 100px; background: orange;}