The are 2 divs below.
One says "This is not MacIE5", and should be visible for all css-supporting browsers except MacIE5.
The other says "This is MacIE5" and should only be visible in Mac IE5
#isnotMacIE5 { display: none; }
#isMacIE5 { display: block; background-color: #060; color: #fff; }
/* commented backslash hack v2 \*/
#isnotMacIE5 { display: block; background-color: #060; color: #fff; }
#isMacIE5 { display: none; }
/* end hack */
v2 of the commented backslash hack was suggested by James Craig.
Originally I'd discovered that if you inserted a comment containing a backslash between rules in your stylesheet, MacIE5 would ignore the next (single) rule .. (provided the selector contained a . or #).
James pointed out that if you move the \ and effectively escape the end-comment marker (removing all characters and space btw the \ and the */),
you can comment out a whole block of rules for MacIE5 - which is mighty handy.
Here's an example of the single-rule commented backslash hack in action:
This paragraph should be highlighted green in IE5/Mac, red otherwise
Browser/OS | Confirmed to work as described? |
---|---|
Win32 IE7 | Yes |
Win32 IE6 | Yes |
Win32 IE5.5 | Yes |
Win32 NN4.7 | Yes |
Win32 NN6.2 | Yes |
Win32 Opera 6 | Yes |
Win32 Mozilla 1, Firefox 1.5, 2.0 | Yes |
Mac(OS9/Classic) IE5.0 | Yes |
Mac(OS9/Classic) IE5.1 | Yes |
Mac(OSX) IE5.2 | Yes |
Mac(OSX.1) Mozilla 1.0 | Yes |
my CSS page
an @import based way of isolating css for/from macIE5
and this article on developer.apple.com CSS Hints for Internet Explorer 5