You are using IE/Mac 5.0 or 5.1

You are not using IE/Mac 5.0 or 5.1


The nature of this hack makes it useful for hiding single rules from IE/Mac 5.0 & 5.1 but not for large numbers of rules. It requires that the rule we wish to hide be rewritten 3 times in a row with various hacks applied to each line. Here's an example of the hack and how it works:

  1. p.iemac50
  2. {
  3.   display: block;
  4.   display/* \ */: none;
  5.   display: none;
  6.   /* \*/ display: none; /* */
  7. }

Line 3 contains the initial value for the property we want. This should be set to whatever value IE/Mac 5.0 & 5.1 (and any non-CSS browser) should use.

Lines 4-6 set the same exact rule. This is the rule we want everyone but IE/Mac 5.0/5.1 to use.

Line 4 uses a variation of the IE/Mac backslash hack. This hides the rule from IE/Mac (all versions) and IE/Win 5.0. A byproduct of this hack is that IE 5.0 and IE/Mac 5.1 will ignore the next rule in the stylesheet.

Line 5 is ignored by IE/Mac 5.0/5.1 but is read by IE/Mac 5.2 and every other browser out there, except....

Line 6 is being read by IE/Win 5.0. IE/Win 5.0 also suffers the same issue IE/Mac 5.0 does in that the slash hack seen in line 4 will cause IE/Win 5.0 to ignore the rule in line 5. So we need to set the rule a third time for IE/Win 5.0. To keep IE/Mac 5.0/5.1 from reading this rule, we use a slightly different version of the backslash hack. This time only IE/Mac ignores the rule, while IE/Win 5.0 will read the rule in just fine.

Best of all: this is valid CSS.