http://jsfiddle.net/YZdv4/50/ 这里的jsfidles
我想你可以用绝对的定位和刺绣来完成这个任务, 但是,用css/floats就可以解决问题吗?
对不起, 如果这很难理解, 但是 Im 试图使紫色 bg 转向
beground:papayawhip
, 使父体 100%的高度为
。
<div id="container" class="cf">
<div id="header">
<p>im header</p>
</div>
<div id="content" class="cf">
<div id="left"><p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce viverra enim sit amet ante lacinia iaculis. Nullam ac nulla vel purus posuere luctus. Mauris a elit nisl. Mauris commodo convallis sem in feugiat. Suspendisse mauris leo, molestie sit amet commodo eget, mollis a nibh. Suspendisse auctor commodo interdum. Aliquam posuere, erat eget pharetra hendrerit, mi tellus tristique tellus, vel accumsan elit nisi ac diam. Morbi consequat ligula est, et volutpat ante. Curabitur pulvinar nulla non neque iaculis pulvinar sed eu sapien. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Fusce sodales metus et nisl dictum non ullamcorper magna blandit. Aliquam erat volutpat. Aenean id massa sed massa sollicitudin euismod sed non lorem. Sed accumsan, nisl vitae adipiscing cursus, magna enim accumsan augue, a rutrum mauris lorem non mauris. Sed consequat venenatis venenatis.
</P></div>
<div id="right">
<img src="http://vvcap.net/db/0ggWsnKKw1FI1w0xojUT.png" />
<img src="http://vvcap.net/db/Rik9UwaQOUuhKpML16td.png" />
</div>
</div>
<p>im the container</p>
</div>
div#container{background:yellow;min-height:500px;}
div#header{background:pink; height:100px;}
div#content{position:relative;background:purple; height:100%;}/*heres parent container*/
div#content #left{float:left; height:100%; background:#222; color:#fff;width:50%;}
div#content #right{float:left; height:100%; background:papayawhip;width:50%;}
div#content #right img{}
/* For modern browsers */
.cf:before,
.cf:after {
content:"";
display:table;
}
.cf:after {
clear:both;
}
/* For IE 6/7 (trigger hasLayout) */
.cf {
*zoom:1;
}
调
调