/* first apply the 9 hack for any version of internet explorer, for example */
body
{
background: #f009;
}
/* … then override the above rule by using the CSS3 :root selector which is supported by IE9, but still use the 9 hack to filter out only IE9 */
:root body
{
background: #ccc9;
}
[/sourcecode]
By using the above CSS you can have special styles, which are the same for Internet Explorer 6-8 and other rules for Internet Explorer 9 without affecting other browsers.
© 2006 - 2023 Martin Ivanov