IE8 css selector

后端 未结 14 1858
臣服心动
臣服心动 2020-11-30 22:44

To target elements only in IE browsers i\'ll use

IE6:

* html #nav li ul {
    left: -39px !important;
    border: 1px solid red;
}

相关标签:
14条回答
  • 2020-11-30 23:17

    \9 doesn’t work with font-family, instead you’d need to use “\0/ !important” as Chris mentioned above, for example:

    p { font-family: Arial \0/ !important; }
    
    0 讨论(0)
  • 2020-11-30 23:17

    There aren't any selector hacks for IE8. The best resource for this issue is http://browserhacks.com/#ie

    If you want to target specific IE8 you should do comment in html

    <!--[if IE 8]> Internet Explorer 8 <![endif]-->
    

    or you could use attribute hacks like:

    /* IE6, IE7, IE8, but also IE9 in some cases :( */
    #diecinueve { color: blue\9; }
    
    /* IE7, IE8 */
    #veinte { color/*\**/: blue\9; }
    
    /* IE8, IE9 */
    #anotherone  {color: blue\0/;} /* must go at the END of all rules */
    

    For more info on this one check: http://www.paulirish.com/2009/browser-specific-css-hacks/

    0 讨论(0)
提交回复
热议问题