我有 2 个容器,向左浮动:
- 带有隐藏溢出的框 1(红色 div)
- 高度为 100% 的框 2(黄色 div)
我希望框 1 始终填充到 100%,即使框 2 变大
<style>
* {margin:0;}
html {position: relative; min-height: 100%;}
body {margin: 0 0 100px;}
#footer{
position: absolute;
left: 0;
bottom: 0;
height: 100px;
width: 100%; background:gray;
}
#box1{width:200px; background:yellow; float:left; height:100%}
#box2{width:600px;background:red; float:left; overflow:hidden; height:2000px; }
</style>
<div id='box1'></div>
<div id='box2'></div>
<div id='footer'></div>