Generally speaking, when we write a better structure, there is no difference between ie8/9. So few people can focus on CSS hack that only IE8 or IE9 recognize.
Because IE8 and the following version is not supported CSS3, but if we use CSS3, under IE IE9 Normal rendering, but we want to let IE8 and the following browser to achieve the same effect, and do not want to use Css3pie or HTC or conditional comments, and other methods, You may need to use the exclusive CSS hack of IE8 and IE9.
- . test{/* 1. */
- /* Color: #09F; It used to be IE8/9, and now it supports * /
- Color: #09F \0/; /*Used to beIE8 only, now ie9/10 also supports ie9 need to use the following Span style= "FONT-FAMILY:SIMSUN; FONT-SIZE:10.5PT, "lang=" en-US ">rule reset ie9 */
- }
- @media all and (min-width:0) {/* 2. */
- . test{color:red\9;} /* IE9 only, now IE10 also support * /
- /* Ps: The Foreigner's method is all , did not consider Opera * *
- }
- @media screen and (-ms-high-contrast:active), (-ms-high-contrast:none) {/* 3. */
- . test {Color:green;}/* ie10+ */
- }
- : root. Test {color: #963 \9;}/* Previously IE9 only, now 10 is also supported, priority is higher than @media, priority is too high, try to use less */
Note: IE old do not follow the rules, before IE8 only/ie9 only hack, IE10 a appeared all messed up ~
In order to avoid reading this article to the disappointment of the students, the new sort of content (2013-01-28), if there is a mistake to point out.
Now, to write a hack specifically for IE8 or IE9, combine the 1/2/3 species together. If you can, use CSS conditional annotations more reliable.
This hack has been added to the one I wrote in 08 in a browser test written in CSS.
From <http://www.fantxi.com/blog/archives/ie8-ie9-css-hack/>