IE7 fixes many bugs and adds support for some selectors, so now hack that are hidden or displayed for IE, such as *html {} and Html>body {}, will expire in IE7. Although CSS Hack is not recommended, conditional annotations are foolproof filters, but conditional annotations can only appear in HTML, CSS Hack is still useful. Nanobot found some CSS Hack for IE7, specifically:
>body
html*
*+html
These three kinds of writing, the first two are illegal CSS writing, in the standard compatible browser is ignored, but IE7 do not think so. For >body, it replaces the missing selector with the global selector *, which means it is treated as a *>body, and not only for the > selector, but also for the +,~ selector. For html*, because there is no space between HTML and *, it is also a CSS syntax error, but IE7 will not ignore, but mistakenly think there is a space. For the third *+html,ie7 that the DTD declaration in front of the HTML is also an element, the HTML will be selected, and this is the only method in the three methods that is valid for CSS writing, that is, it can be validated by a validator and therefore is the hack usage recommended by the author.
Finally, the author gives the best way:
IE 6 and below
Use * HTML {} to select the HTML element.
IE 7 and below
Use *+html, * HTML {} to select the HTML element.
IE 7 only
Use *+html {} to select the HTML element.
IE 7 and modern browsers only
Use Html>body {} to select the BODY element.
Modern browsers only (not IE 7)
Use Html>/**/body {} to select the BODY element.
Specific information Reference original: Easy CSS hacks for IE7