.top{height:100px;background:#ccc;margin:0 auto}.main{height:600px;background:red;position:relative}.left{ height: 600px; width:200px; background: blue; positive:absolute;top:0;left:0}.right{ height: 600px; width:100%; background: green; position:absolute; margin-left:210px; }.foot{height:50px;background:#F63;}
2 回答
渊翼
TA贡献2条经验 获得超0个赞
width: 100%也就是说宽度跟父元素一样宽,然后又加了一个margin-left:210px,结果所以就超出父元素啦。
所以可以把.right的样式修改一下,最终代码如下:
.top{
height: 100px;
background: #ccc;
}
.main{
height: 600px;
background: red;
position: relative
}
.left, .right {
position: absolute;
top: 0;
height: 100%;
}
.left{
width: 200px;
background-color: blue;
left: 0
}
.right{
background-color: green;
left: 210px;
right: 0;
}
.foot{
height: 50px;
background: #F63;
}- 2 回答
- 0 关注
- 1153 浏览
相关问题推荐
添加回答
举报
0/150
提交
取消
