很久没有更新文章了,今天分享下IE hack的心得,是在帮朋友修改网页时遇到到的问题,同样的一块“<li>”无序列表在三个版本的IE(ie678)里面表现不同的布局(基本上都是1px的凹凸),下面是Google到的解决方案:

  • ie8兼容问题

这个比较好搞,只要在html里面添加:

<meta http-equiv=”x-ua-compatible” content=”ie=7″ />

即可实现与IE7一样的表现效果。

  • 如何区分 ie6、ie7、ie8和FF

selector{

property:value; /* 所有浏览器 */

property:value\9; /* 所有IE浏览器 */

*property:value; /* IE7 */

_property:value; /* IE6 */

}

selector{
property:value; /* 所有浏览器 */
property:value\9; /* 所有IE浏览器 */
*property:value; /* IE7 */
_property:value; /* IE6 */
}
  • flaot浮动造成IE6下面双倍边距问题

用!important解决,比如
margin-left:10px !important;/*IE7,IE8,FF下是10PX*/;
margin-left:5px;/*IE6下属性写的是5PX,但在显示出来的是10px;

暂时就这三个,以后遇到在补上!

相关日志