我正在尝试构建一个页面布局,其中左列具有固定的宽度和 100% 的高度(无论右列是什么),而右列具有可变宽度。我尝试了各种方法,但似乎无法做到正确..
这是我的代码:
<div id="pageHolder">
<div id="topSection">
header goes here
</div>
<div id="pageContainer">
<div id="leftColumn">
<div id="leftHolder">
left stuff goes here
</div>
</div>
<div id="rightColumn">
<div id="rightHolder">
right stuff goes here
</div>
</div>
</div>
<div id="bottomSection">
footer goes here
</div>
</div>
我的CSS是:
body {
height: 100%;
}
div#pageHolder {
}
div#topSection {
padding: 0px 0px 0px 0px;
margin: 0px 0px 0px 0px;
}
div#pageContainer {
position: relative;
width: 100%;
height: 100%;
padding: 0px 0px 0px 0px;
margin: 0px 0px 0px 0px;
}
div#leftColumn {
position: relative;
float: left;
width: 285px;
height: 100%;
padding: 0px 0px 0px 0px;
margin: 0px 0px 0px 0px;
}
div#leftHolder {
padding: 25px 25px 25px 25px;
margin: 0px 0px 0px 0px;
}
div#rightColumn {
position: relative;
height: 100%;
min-height: 100%;
padding: 0px 0px 0px 0px;
margin: 0px 0px 0px 285px;
}
div#rightHolder {
padding: 25px 25px 25px 25px;
margin: 0px 0px 0px 0px;
}
div#bottomSection {
clear: both;
}
如果有人可以帮助我,那就太好了:)