浏览器兼容专题
  • 微信/手机站
  • 电脑板
  • 服务案例
  • 关于我们
  • 域名注册
  • 商标注册
  • 上云服务
  • 微信小程序
  • 知识库
  • IE兼容性HACK表示方法

    2015-09-08 12:14:23
    IE兼容性HACK表示方法

    1.IE浏览器CSS hack兼容表

    什么是css hack:针对不同的浏览器写不同的CSS code的过程,就叫CSS hack
    selector{ 
      background-color:#f00;  /* all */
      background-color:#0ff\0;  /* ie8/9 */
      background-color:#0f0\9\0;  /* ie9 */
      *background-color:#00f;  /* ie6/7 */
      _background-color:#ff0;  /* ie6 */
      background-color//:#090;  /* 非I E*/
      background-color:#900\9;  /* 所有ie */
    } 
    
    注意:要使用以上代码,必须把反斜线修改为英文下的反斜线。
    (1)区别IE6与FF
    background:orange;*background:blue;
    (2)区别IE6与IE7
    background:green !important;background:blue;
    (3)区别IE7与FF
    background:orange; *background:green;
    (4)区别FF,IE7,IE6
    background:orange;*background:green !important;*background:blue;
    注:IE都能识别*;标准浏览器(如FF)不能识别*;
    IE6能识别*,但不能识别 !important,
    IE7能识别*,也能识别!important;
    FF不能识别*,但能识别!important;

    2.终极方法:条件注释

    
    
    
    
     
    
    
    
    缺点是在IE浏览器下可能会增加额外的HTTP请求数。
  • 回顶部
品牌策划 版权所有 2022-2027
滇ICP备16002320号-1 公安备案号 53262102000249
服务热线:0876-2154551 15987653936