HTML 代码:
<div class="container">
<div class="menu">
<div class="target">
</div>
</div>
<div class="main"></div>
</div>
CSS代码:
.container{
position : absolute;
height : 100%;
width : 100%;
background-color : green;
}
.menu{
position : absolute;
top:0;
left :0;
height: 100%;
width : 30%;
background-color : orange;
}
.main{
position : absolute;
top:0;
left : 30%;
height : 100%;
width : 70%;
background-color : blue;
}
.target{
position : relative;
top : 20px;
left : 10%;
height: 70%;
bottom : 100px;
width : 80%;
background-color : pink;
overflow-y : auto;
}
问题:
我想删除' ' divheight
中的 ' ' 属性,因此 div 的 ' ' 将仅取决于 ' ' 和 ' ' 属性。.target
height
top
bottom
.menu
我的目标是在“ ”底部和“”底部之间保持固定距离.target
,可选择不指定“ height
”。
我真的希望我的问题足够清楚,如果不是问我,完整的代码在http://jsfiddle.net/dGkFq/3/。
非常感谢。