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

时间:2016-05-24 20:51:04   收藏:0   阅读:1557

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;

 

评论(0)
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!