• IE各版本CSS Hack(兼容性处理)语法速查表


    为了兼容IE各个版本,需要在CSS中添加额外的代码,比如以前常用的_width。之所以工作,是因为浏览器会忽略不能解析的样式规则,因此举个例子来说,把_width写在width下面,对于非IE浏览器会解析到width,而对于IE6来说,会用_width覆盖前面的width规则,从而达到针对IE6浏览器的兼容。对于IE其他版本(6~11),也存在同样的兼容性处理方法。虽然本站不对IE做特别的兼容性测试,基本上只支持Chrome/FF/Edge/Safari,但有时候客户项目会有这方面需求,下面是一个速查表:

    div {
    property:value;  /* ie 8/9*/
    property:value9;  /* ie 9*/
    *property:value;  /* ie 7*/
    _property:value;  /* ie 6*/
    }

    IE 6

    * html .ie6 {property:value;}

    or

    .ie6 { _property:value;}

    IE 7

    *+html .ie7 {property:value;}

    or

    *:first-child+html .ie7 {property:value;}

    IE 6 and 7

    @media screen9 {
        .ie67 {property:value;}}

    or

    .ie67 { *property:value;}

    or

    .ie67 { #property:value;}

    IE 6, 7 and 8

    @media screen\,screen9 {
        .ie678 {property:value;}}

    IE 8

    html>/**/body .ie8 {property:value;}

    or

    @media screen {
        .ie8 {property:value;}}

    IE 8 Standards Mode Only

    .ie8 { property /***/: value9 }

    IE 8,9 and 10

    @media screen {
        .ie8910 {property:value;}}

    IE 9 only

    @media screen and (min-0) and (min-resolution: .001dpcm) { 
     // IE9 CSS
     .ie9{property:value;}}

    IE 9 and above

    @media screen and (min-0) and (min-resolution: +72dpi) {
      // IE9+ CSS
      .ie9up{property:value;}}

    IE 9 and 10

    @media screen and (min-0) {
        .ie910{property:value9;} /* backslash-9 removes ie11+ & old Safari 4 */}

    IE 10 only

    _:-ms-lang(x), .ie10 { property:value9; }

    IE 10 and above

    _:-ms-lang(x), .ie10up { property:value; }

    or

    @media all and (-ms-high-contrast: none), (-ms-high-contrast: active) {
       .ie10up{property:value;}}

    IE 11 (and above..)

    _:-ms-fullscreen, :root .ie11up { property:value; }
  • 相关阅读:
    Libgdx之Music Sound 音效
    [Android]Activity的生命周期
    Android开发中无处不在的设计模式——动态代理模式
    Wireshark数据抓包分析——网络协议篇
    iOS-一个弹出菜单动画视图开源项目分享
    给Java开发人员的Play Framework(2.4)介绍 Part1:Play的优缺点以及适用场景
    mybatis自己学习的一些总结
    Cocos2d-x 源代码分析 : Scheduler(定时器) 源代码分析
    exe4j打包java应用程序
    删除sql server用户时报15138错误
  • 原文地址:https://www.cnblogs.com/smedas/p/12454719.html
Copyright © 2020-2023  润新知