如何在使用float的情况下防止div脱离正常文档流,例如:
<div id="one">
<div id="two"></div>
</div>
CSS:
#one {
width: 100%;
height: auto;
}
#two {
width: 100px;
height: 100px;
position: relative;
float: left;
}
现在 div "one" 没有高度,而 div "two" 看起来就像不在第一个 div 中一样。