ie hack

其实总结起来就这几句话  html

#test{
color:red;
color:red !important;/ Firefox、IE7支持 */
_color:red; / IE6支持 */
*color:red; / IE六、IE7支持 */
*+color:red; / IE7支持 */
color:red\9; / IE六、IE七、IE8支持 */
color:red\0; / IE8支持 */
}网站

 
 另外

一、若是你的页面对IE7兼容没有问题,又不想大量修改现有代码,同时又能在IE8中正常使用,微软声称,开发商仅须要在目前兼容IE7的网站上添加一行代码便可解决问题,此代码以下:
<meta http-equiv=”x-ua-compatible” content=”ie=7″ />ui

二、body:nth-of-type(1) 若是这样写,表示全局查找body,将会对应第一个<body>。htm

三、还有其余写法,好比:
*html #test{}或者 *+html #test{}开发

四、*+html 对IE7的hack 必须保证HTML顶部有以下声明:get

http://www.w3.org/TR/html4/loose.dtdio

五、顺序:Firefox、IE八、IE七、IE6依次排列。
相关文章
相关标签/搜索