XML technologies / CSS / CSS Cookbook / Hacks, workarounds and troubleshooting / CSS rules hidden from Internet Explorer 5 for Macintosh
(Excerpt from “CSS Kochbuch” by Christopher Schmitt)
Problem
You want to hide certain CSS rules from Internet Explorer 5 for Macintosh.
Solution
You can hide certain CSS rules from Internet Explorer 5 for Macintosh by placing a backslash (\) before the closing comment delimiter:
/* \*/
h1 {
font-size: 200%;
text-transform: uppercase;
background-color: #666;
}After the rules to be hidden from Internet Explorer 5 for Macintosh, insert another comment line:
/* */
p {
text-transform: uppercase;
}Discussion
This method exploits a small problem in Internet Explorer 5 for Macintosh’s comment parser. The backslash before the closing comment delimiter makes the browser treat the comment as unfinished, so it ignores all rules until the next closing comment delimiter.
See also
The CSS 2.1 specification on comments in CSS.
Copyright of the German edition © 2007 by O’Reilly Verlag GmbH & Co. KG
You may print the online version for your private use.
Otherwise, this chapter from “CSS Kochbuch” is subject to the same conditions as the bound edition: the work, including all its parts, is protected by copyright. All rights reserved, including reproduction, translation, microfilming, and storage and processing in electronic systems.
O’Reilly Verlag GmbH & Co. KG, Balthasarstr. 81, 50670 Köln