IE7:
<!
DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-
transitional.dtd"
>
<
html
>
<
head
>
<
meta
http-equiv
="X-UA-Compatible"
content
="IE=EmulateIE7"
/>
<
title
></
title
>
</
head
>
<
body
>
<
div
style
="width:600px;height:300px;background-color:Black;float:left;"
></
div
>
<
div
style
="width:600px;height:300px;background-color:Yellow;float:right;"
></
div
>
<
div
style
="background-color:Green;height:100px;"
>
aa
</
div
>
<!--
在IE7下div并不会被隐藏到浮动元素的下方,说
明浮动元素对于div来说是占位的
-->
<
table
style
="background-color:Red;height:10px;width:10px;"
>
<!--
在IE7下浮动元素对table会占位
-->
<
tr
>
<
td
>
</
td
>
</
tr
>
</
table
>
<
span
style
="clear:both;"
>
<!--
在IE7下非块级元素可以清除浮动
-->
456
</
span
>
![IE7与FireFox、IE8下CSS浮动对比 IE7与FireFox、IE8下CSS浮动对比](https://image.shishitao.com:8440/aHR0cHM6Ly93d3cuaXRkYWFuLmNvbS9pbWdzLzMvOC83LzUvOTAvNzMxNjU1OTU0YzdiZTlkODgzNWVjZTU1MWI1Mzg1ZjguanBl.jpe?w=700&webp=1)
</
body
>
</
html
>
FireFox/IE8
另外有几个需要注意的地方:
div的display:inline后会完全消失
在IE和FireFox下: