【发布时间】:2013-03-09 11:45:56
【问题描述】:
好吧,伙计们,我一直在为这个而烦恼。
我有三个 div;左,中,右。全部 100% 高度。左右 div 的宽度固定为 150px。现在我想让中间的 div 占据剩余的空间。
示例:Here
CSS:
#left {
height:100%;
width:150px;
float:left;
background:red;
z-index:999;
}
#middle {
height:100%;
width:100%;
background:yellow;
margin-left:-150px;
margin-right:-150px;
}
#right {
float:right;
height:100%;
width:150px;
background:red;
z-index:998;
}
【问题讨论】:
-
只用谷歌搜索 css 布局,你会在其中一个页面上发现非常相似的东西,如果不一样的话,这是很常见的问题。