2012-07-31 73 views
0

我正在尝试创建一个将展开到其容器底部的div。该布局由父容器中的两列组成。两列的宽度都是百分比,并且父容器和左列的高度根据左列中的幻灯片显示进行扩展。我想让右栏的高度与左边的高度相匹配,所以我可以在底部定位一些东西。我尝试了很多不同的东西,但无济于事。这里是页面:展开与可变高度和宽度的div

http://whub30.webhostinghub.com/~scottl9/testindex2.html

的HTML是

<div id="content_section"> 
    <div class="imgwrap"> 
     <div class="imgwrap2"> 
     Left-column content 
     </div> 
     <div class="playersection"> 
     Right-column content 
     </div> 
    </div> 
<div class="clearall"></div> 
</div> 

和相应的CSS是

#content_section { position:relative; min-height:400px; min-width:600px; max-height: 1000px; max-width:2000px;} 
.imgwrap {position:relative; width:100%; height:auto; min-width:409px; min-height:230px; border-style:solid; border-width:medium; display: inline-block;} 
.imgwrap2 {position:relative; float:left; width:70%; height:auto;} 
.playersection {border-style:solid; width:30%; position: relative; float: right; border-width:medium;} 
.clearall {clear:both;}` 

任何(我加了边框,所以我能看到的div)。帮助将不胜感激!

回答

0

尝试将右列的高度更改为100%。

.imgwrap2 {position:relative; float:left; width:70%; height:100%;} 
+0

这是左栏,我试过了,它不起作用。要将高度设置为百分比,我必须将所有包含高度设置为百分比或设置值。我无法做到这一点,因为我希望两列的高度在左栏中的图像高度展开。 – user1561152 2012-08-01 04:06:14