Most folks know about the so-called “star hack” for IE.
However, there are two other varieties of IE-only hacks that are perhaps a bit more useful.
All of these work, in some form or another for IE. I tested them all in various flavors to arrive at my favorite (sic).
You can set up a test harness yourself using this code to see for yourself.
- _ hack WORKS for: IE8 Quirks, IE7 Quirks, IE6
- _ hack DOES NOT WORK for: IE8 IE8 Standards, IE8 IE7 Standards, IE7 IE7 Standards
- * hack works for: IE8 Quirks, IE8 IE7 Standards, IE7 Quirks, IE7 IE7 Standards, IE6
- * hack DOES NOT WORK for: IE8 IE8 Standards
- \9 hack WORKS for: IE8 IE8 Standards, IE8 IE7 Standards, IE8 Quirks mode, IE7 Quirks, IE7 Standards (all varieties of IE8), IE6
So, in short, if you want an IE CSS hack that works in all flavors of IE, use the backslash-nine hack. That is, just put a \9 after *whatever* css value you are assigning.
Good luck. I feel this to be quite a discovery.