ie8兼容性解决及所遇到bug总结

ie8兼容性代码:

在<head>标签内添加<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" /> 也就是将IE8使用IE7进行渲染;

ie6和ie7 兼容性bug

ie7不支持padding属性 因此只能用margin代替 但是如果直接加margin 会影响其他浏览器 所以要使用ie7的兼容代码 *margin 

当然* 是ie6和ie7都兼容的 如果想单解决ie7的使用的方法是!important  ie8的是例如margin:10px \ 0;

css hack:

!important 

随着IE7对!important的支持, !important 方法现在只针对IE6的HACK.(注意写法.记得该声明位置需要提前.) 
<style>
#wrapper 

width: 100px!important; /* IE7+FF */ 
width: 80px; /* IE6 */ 

</style>

IE6/IE77对FireFox :
*+html 与 *html 是IE特有的标签, firefox 暂不支持.而*+html 又为 IE7特有标签. 
<style> 
#wrapper 

#wrapper { width: 120px; } /* FireFox */ 
*html #wrapper { width: 80px;} /* ie6 fixed */ 
*+html #wrapper { width: 60px;} /* ie7 fixed, 注意顺序 */ 

</style>

------------------------------华丽的分割线-----------------------------------------------------

为什么要加分割线 因为以下的方法仅供参考 不能是最准确的解决方法

当span中里有文字 并且span的css是display:block; float:left;的时候 可以发现文字是无法在span内的 这个时候只要把span添加css属性line-height 文字就可以到span内中了

当ie7下无法用有需要超出包着该标签的时候 float是无法解决该问题 这时候需要用到 position:absolute;

针对ie9的hack

:root #foo{
color:#eee\9;
}

 

 

你可能感兴趣的:(bug)