Apply style ONLY on IE

后端 未结 12 2175
迷失自我
迷失自我 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:25

    It really depends on the IE versions ... I found this excellent resource that is up to date from IE6-10:

    CSS hack for Internet Explorer 6

    It is called the Star HTML Hack and looks as follows:

    • html .color {color: #F00;} This hack uses fully valid CSS.

    CSS hack for Internet Explorer 7

    It is called the Star Plus Hack.

    *:first-child+html .color {color: #F00;} Or a shorter version:

    *+html .color {color: #F00;} Like the star HTML hack, this uses valid CSS.

    CSS hack for Internet Explorer 8

    @media \0screen { .color {color: #F00;} } This hacks does not use valid CSS.

    CSS hack for Internet Explorer 9

    :root .color {color: #F00\9;} This hacks also does not use valid CSS.

    Added 2013.02.04: Unfortunately IE10 understands this hack.

    CSS hack for Internet Explorer 10

    @media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) { .color {color: #F00;} } This hacks also does not use valid CSS.

提交回复
热议问题