css中如何实现左边的高度随着右边改变而改变

div结构:

<div class="container">
<div class="left"></div>
<div class="right"></div>
</div>

css:

.container {width:960px; height:100%; overflow:hidden; margin:0 auto;}
.left {height:100%; width:200px; overflow:hidden; padding-bottom:9999px; margin-bottom:-9999px; float:left; display:inline;}
.right {width:750px; float:right; height:auto;}

核心作用的是:

height:100%; overflow:hidden; padding-bottom:9999px; margin-bottom:-9999px;

 

posted @ 2016-05-24 19:34  G善源  阅读(963)  评论(0编辑  收藏  举报