解决firefox与IE显示差异问题 "clear:both"

| | Comments (0)



今天在修改页面的时候,发现页面在firefox和ie下显示有差异,firefox div和页脚浮动交叉显示,ie显示为正常。问了下朋友,据说firefox显示的才是正确的,本来就在同一行,只是ie和firefox的兼容问题,告诉我可以用clear:both解决问题。

又参考了别人的模版代码,发现了一个有用的参数"clear:both;"。我在页脚前加了一句:

,问题解决了,也没有影响页面的加载速度。

在解决问题后还是了解一下解决的原理比较好。于是百度了一下,终于明白了 clear:both;的作用就是阻断该代码之前的浮动属性。所以,在页脚前放一个clear:both;就使页脚无法继承浮动属性,老老实实地呆在最下面了。

最后,firefox和ie下显示效果一样了,问题得以解决。

Leave a comment

Archives

Ads by google

Pages

Powered by Movable Type 4.24-en

About this Entry

This page contains a single entry by 单点日志 published on July 14, 2009 12:16 PM.

2009 新片 守望者 Watchmen was the previous entry in this blog.

纪念我的外婆 is the next entry in this blog.

Find recent content on the main index or look in the archives to find all content.