要扩展我的评论,你不能在语义上做到这一点.你必须使用一个小技巧来伪造100%的高度.它被称为人造柱,您可以阅读更多
here.
在你的情况下,我们可以通过添加一些背景div来伪造它:
然后改变你的CSS:
#wrapper {
border: 1px solid black;
position: relative;
}
#wrapper:after {
display: block;
content: " ";
height: 0;
clear: both;
}
.block {
position: relative;
float: left;
vertical-align: top;
width: 200px;
text-align: left;
min-height: 200px;
padding-left: 20px;
z-index: 2;
}
.background {
position: absolute;
top: 0;
bottom: 0;
width: 200px;
z-index: 1;
}
.bg1 {
background-color: #eee;
}
.bg2 {
left: 200px;
background-color: #aaa;
}