<div id="contenetarea" style="width:1000px; margin:auto">
<div id="mainarea" style="width:650px;float:left;">
</div>
<div id="sidebar" style="width:350px;float:left;">
</div>
</div>
我想要 contentarea height=max(mainarea.height,sidebar.height) 我的 google cse 结果页面有问题.. 我该如何解决?
有没有办法做到这一点:mainarea.height=sidebar.height=max(mainarea.height,sidebar.height)
最佳答案
尝试将 overflow: hidden;
添加到 #contentarea
。这将导致它将所有内容包裹在其中,甚至是 float 元素。
关于css - 子元素 float 时的外部元素高度,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8467019/