什么是目前清除浮动的最佳解决方案,例如“< div style ='clear:both'>< / div>" ;? [英] What is the current best solution to clear floats, such as "<div style='clear: both'></div>"?
本文介绍了什么是目前清除浮动的最佳解决方案,例如“< div style ='clear:both'>< / div>" ;?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我已使用
<div style="clear: both"></div>
清除浮动...并且看到的是
to clear the floats... and have seen cases where it is
<div style="clear: both; height: 1px; line-height: 1px"></div>
并且已经看到了clearfix,有些隐藏了。
并使其与背景颜色相同。现在Compass和Blueprint也有一个 + clearfix
。现在最好的清除浮动的方法是什么,现在可能我们不需要支持IE 6?
and have seen clearfix, and some with a hidden .
and make it the same color as the background. Now Compass and Blueprint also have a +clearfix
. What is the current best way to clear floats, now that probably we don't need to support IE 6?
推荐答案
了解到
content:;
display:table;
clear:both;
可在IE 8之后的所有浏览器中使用
I have learned that
content: "";
display: table;
clear: both;
work with all browsers after IE 8+
这篇关于什么是目前清除浮动的最佳解决方案,例如“< div style ='clear:both'>< / div>" ;?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文