IE6下DIV错位

来源:互联网 发布:德章泰穆雷体测数据 编辑:程序博客网 时间:2024/04/29 12:43

这是因为IE6采用的内核默认把DIV之间的距离增加了3~5个PX。

针对firefox ie6 ie7的CSS样式,现在大部分都是用!important来hack,对于ie6和firefox测试可以正常显示,但是ie7对!important可以正确解释,会导致页面没按要求显示!一个针对IE7不错的hack方式就是使用"*+html”,现在用IE7浏览一下,应该没有问题了现在写一个CSS可以这样:
#1 { color: #333; } /* Moz */
* html #1 { color: #666; } /* IE6 */
*+html #1 { color: #999; } /* IE7 */

那么在firefox下字体颜色显示为#333,IE6下字体颜色显示为#666,IE7下字体颜色显示为#999。

为了建立更加良好的测试环境,我下载了iecollection1604 。它可以模拟多种IE版本来浏览所测试的网页。大致有: 

  • Internet Explorer 1.0 (4.40.308)
  • Internet Explorer 1.5 (0.1.0.10)
  • Internet Explorer 2.01 (2.01.046)
  • Internet Explorer 3.0 (3.0.1152)
  • Internet Explorer 3.01 (3.01.2723)
  • Internet Explorer 3.03 (3.03.2925)
  • Internet Explorer 4.01 (4.72.3110.0)
  • Internet Explorer 5.01 (5.00.3314.2100)
  • Internet Explorer 5.5 (5.51.4807.2300)
  • Internet Explorer 6.0 (6.00.2800.1106)
  • Internet Explorer 6.0 (6.00.2900.2180)
  • Internet Explorer 7.0 (7.00.5730.13)
  • Internet Explorer 8.0 (8.00.6001.18702)

可按照自己的需要进行安装。