对于IE6

background-color:blue;
_background-color:red;

如果IE7,IE6同时有问题
以下2选一:

background-color:blue;
*background-color:red;

background-color:blue;
+background-color:red;

如果只有IE7 

 background-color:blue;
 *background-color:red;
 _background-color:blue;/*还原IE6*/

对于IE8

background-color:blue;
background-color:red\9;/*用作于IE6,IE7,IE8,IE9*/
*background-color:blue;/*还原IE6、7*/
background-color:blue\9\0;/*还原IE9*/

对于IE9 

background-color:blue;
background-color:red\9\0;/*作用于IE9*/
_background-color:blue;/*IE6无法识别,所以要恢复IE6~*/

对于整个IE

background-color:blue;
background-color:red\9;

!important

用于所有浏览器--不能算做是hack了 加上!important 可以完全无视css优先级了

相关文章:

  • 2021-07-29
  • 2022-02-20
  • 2021-06-26
猜你喜欢
  • 2021-10-02
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-01-23
相关资源
相似解决方案