mainContent
{
width: 100%;
height: 100%;
position: absolute;
left: 200px; //这里我是为了给左侧的垂直导航栏留出位置
top: 0px;
bottom: 0;
}
那么问题来了,这样DIV的宽度会比预期想要的多出200PX,会有横向滚动条出现。
试了加上 right=-200px; margin-right/padding-right:-200px,但是没有作用。
请问这种情况该怎么解决?
补充图例---------------------------
左侧垂直导航条固定200PX宽,100%高;右侧内容100%宽。
你为什么要用position:absolute来定位整个主内容区呢?
这就是经典两栏自适应布局。
https://jsfiddle.net/begrgptf/