As far as I know, it's necessary to also add the “filter” stye in IE8. And I think it has to be put AFTER the “-ms-filter”.
IE8 has an IE7 compatibility mode, so you can be in IE8 with CSS behaving as in IE7. That's why the algorythm makes the “filter” case happen for any IE version, even in IE8.
This would be false if IE8 reports itself as IE7 in Compatibility mode, but I don't think so. I haven't tested this because it's as complex as IE8 actually having (take a seat) FOUR rendering modes:
- IE8 Standards mode:
Strict standards (in the Microsoft meaning).
- IE7 Standards mode, also called IE8 Compatibility mode:
Tries to mimic IE7 behaviour... but it only tries to. Several things behave as IE7, but some of them don't. So it's not fully compatible with IE7 nor IE8 default modes. But the real fun about this mode is explained below.
- IE7 Compatibility mode, also called Almost Standards mode:
Real IE7 behaviour. Maybe IE6 behaviour also.
- Quirks mode:
The legacy IE 5.5 rendering engine, for pages designed for really older IE versions. No need to worry about this, I think.
Some info on this:
http://books.google.com/books?id=hVsCia9J8XEC&pg=PT241&dq=“The+four+modes+of+IE8”
(paste the URL in your browser's address bar or else the search won't work)
The funniest part is somewhat difficult to handle if you really want to dig deep in CSS. IE8 Standards mode, which is the default in IE8, really breaks current existing webs (made for IE7). But instead of intelligently switching to IE7 Compatibility mode in that case (the natural option), the webs are encouraged to opt-in to IE7 Standards mode (not always IE7 compatible, but also not fully IE8 Standards compliant)... or they'll be forced to, if a bunch of users or Microsoft God decides it. So the IE7 Standards mode may be opted-in by the page with a special meta header, but it can also be triggered by the user with a preference, or by Microsoft with a somewhat arbitrary non-compatible-pages black list, theoretically updated using statistics on people's browser preferences about pages (local user preferences about individual pages gathered by Microsoft servers, hum). So with IE8 no one but Microsoft has full control of what rendering engine is used to render a specific page. And to definitely illustrate the paranoia, Microsoft switched/banned the entire Google.com top level domain to IE7 Standards mode (as I said, not fully compatible with IE7 and IE8 default modes) for having ONE PAGE which wrongly announced that Microsoft stocks were going down. Isn't it funny?
I keep in mind a reasoning that someone told me in these forums: never trust in browser's version, simply check “on the fly” if the browser has a capability or a feature before using it.
So please try the suggested code. Having in mind this Microsoft dynamics, whatever works...
More fun when IE9 arrives.