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

Posted G善源

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了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;

 

以上是关于css中如何实现左边的高度随着右边改变而改变的主要内容,如果未能解决你的问题,请参考以下文章