好的,我相信这很常见,但我似乎无法在任何地方找到答案。基本上我想要一个两列 div 布局,左列是流动的,右列是固定的。我希望这两列的高度填充父容器 div。
目前,我的右 div 没有填充 100% 的高度,我不知道出了什么问题?
HTML div 是:
<div id="nmv_div_twoColumnLayoutContainer">
<div id="nmv_div_twoColumnLeftContainer">
<div id="nmv_div_twoColumnLeft">
<p>the left div is good height</p>
<p>As this is the div that will typically have the most data</p>
</div>
</div>
<div id="nmv_div_twoColumnRightContainer" class="roundedCorners">
<div id="nmv_div_twoColumnRight">
the right div is a menu div but is only showing part
</div>
</div>
<div class="clearBoth"></div>
</div>
和我相关的 css
.roundedCorners {
-moz-border-radius: 2px;
border-radius: 2px;
}
.clearBoth {
clear: both;
}
div#nmv_div_twoColumnLayoutContainer
{
overflow: hidden;
}
div#nmv_div_twoColumnRightContainer
{
float: right;
margin-left: -250px;
width: 250px;
background-color: gold;
}
div#nmv_div_twoColumnLeftContainer
{
float: left;
width: 100%;
background-color: red;
}
div#nmv_div_twoColumnLeft
{
margin: 0 260px 0 0;
height: 100%;
background-color: yellow;
}
div#nmv_div_twoColumnRight
{
width: 250px;
background-color: green;
height: 100%;
}