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;