问题:
当你做流式布局的时候,左侧浮动固定,右侧自适应,这时候右侧不能写宽度,否则右侧会溢出,如图:
如代码,右侧给了浮动距离margin-left以及自身的宽度width:
.contents{
margin-left: 200px;
margin-top: 0;
right: 0;
top: 60px;
bottom: 0;
height: 100%;
width: 100%;
}
解决办法:
去掉width,右侧盒子就会自适应,高度同理。
.contents{
margin-left: 200px;
margin-top: 0;
right: 0;
top: 60px;
bottom: 0;
height: 100%;
//width: 100%;
}
如图: