我已经删除了我的 fiddle 中的 php,因此您可以了解 css 问题。 My Fiddle ,问题是有两列,一列在左边,一列在右边,每当右列中有大量内容时,div 不会清除或推出它下面的任何内容,最初的问题是它是把它变成一个框架 - 所以我解决了这个问题,但现在右栏与下面的部分重叠了??
这里有一张图片来直观地解释一下:
<div class="wrapper" style=" height: auto; overflow: visible;">
<div class="columnsContainer" style="height: auto; overflow: visible;">
<div class="leftColumn">
<div class="bodyheadertop" style="background-color:#498d7b;">
<h3>For sale</h3>
</div>
<div id="triangle-topright" style="float:right; border-top: 25px solid #498d7b; margin-bottom: 40px;">
</div>
<div style="clear:both;"></div>
<div class="salespost">
<div class="salespostleft">
<h4><a href=""></a></h4>
<ul>
</ul>
</div>
<div class="salespostright">
</div>
<div style="clear:both;"></div>
</div>
</div>
<div class="rightColumn">
<div class="bodyheadertopalt" style="background-color:#498d7b;">
<h3>Successful Sales</h3>
</div>
<div id="triangle-topright" style="float:right; border-top: 25px solid #498d7b; margin-bottom: 40px;"></div>
<div style="clear:both;"></div>
</div>
<div class="soldpostright"></div>
<div style="clear:both;"></div>
</div>
<?php } ?>
</div>
</div>
</div>
这是有问题的代码。
最佳答案
我已经解决了这个问题。问题是我使用 em 来计算我的两列。我已将其切换为像素并解决了问题。
关于html - Div 不清除 float ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23826877/