第一种方法:
还好,微软提供了这样一个代码:
<meta http-equiv="x-ua-compatible" content="ie=7" />
把这段代码放到里面,在ie8里面的页面解析起来就跟ie7一模一样的了,所以,基本上可以无视ie8,剩下的代码只需要这样写就可以了
background:#ffc; /* 对firefox有效*/ *background:#ccc; /* 对ie7有效 */ _background:#000; /* 只对ie6有效 */
第二种方法:
以下是兼容IE6/IE7/IE8/FF的写法,注意下面的顺序不可颠倒
margin-bottom:40px; /*ff的属性*/ margin-bottom:140px9; /* IE6/7/8的属性 */ color:red; /* IE8支持 */ *margin-bottom:450px; /*IE6/7的属性*/