Apply style ONLY on IE

后端 未结 12 2145
迷失自我
迷失自我 2020-11-28 01:14

Here is my block of CSS:

.actual-form table {
  padding: 5px 0 15px 15px;
  margin: 0 0 30px 0;
  display: block;
  width: 100%;
  background: #f9f9f9;
  bor         


        
12条回答
  •  执念已碎
    2020-11-28 01:41

    Apart from the IE conditional comments, this is an updated list on how to target IE6 to IE10.

    See specific CSS & JS hacks beyond IE.

    /***** Attribute Hacks ******/
    
    /* IE6 */
    #once { _color: blue }
    
    /* IE6, IE7 */
    #doce { *color: blue; /* or #color: blue */ }
    
    /* Everything but IE6 */
    #diecisiete { color/**/: blue }
    
    /* IE6, IE7, IE8, but also IE9 in some cases :( */
    #diecinueve { color: blue\9; }
    
    /* IE7, IE8 */
    #veinte { color/*\**/: blue\9; }
    
    /* IE6, IE7 -- acts as an !important */
    #veintesiete { color: blue !ie; } /* string after ! can be anything */
    
    /* IE8, IE9 */
    #anotherone  {color: blue\0/;} /* must go at the END of all rules */
    
    /* IE9, IE10, IE11 */
    @media screen and (min-width:0\0) {
        #veintidos { color: red}
    }
    
    
    /***** Selector Hacks ******/
    
    /* IE6 and below */
    * html #uno  { color: red }
    
    /* IE7 */
    *:first-child+html #dos { color: red }
    
    /* IE8 (Everything but IE 6,7) */
    html>/**/body #cuatro { color: red }
    
    /* Everything but IE6-8 */
    :root *> #quince { color: red  }
    
    /* IE7 */
    *+html #dieciocho {  color: red }
    
    /* IE 10+ */
    @media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) {
       #veintiun { color: red; }
    }
    

提交回复
热议问题