Cascading Style Sheets/Hacks and Filters
From Wikibooks, the open-content textbooks collection
[edit] Hacks & Filters
CSS Hacks
All web browsers are not equal and different rendering of the same code, even if the code is validated, can destroy a web page's presentation. To work around this a large community of browser hacks has been developed. These hacks should be avoided at all cost because they may break your code in other browsers or slow down performance. However sometimes it is impossible to avoid the use of these hacks.
Be aware that constant browser updates may cause hacks to not work in the future.
- Media Query Hack Making CSS visible for Opera 7 only
- Import Hack hides files from NetscapeFour and older browsers
- Caio Hack hides rules from Netscape 4, even 'inline' CSS
- Anti Nav Four Selectors simply hide single rulesets from Nav4
- Box Model Hack feeds alternative properties to IE 5.x; several new methods now possible
- Star Html Hack feeds rules to Mac and Windows IE
- Lone Star Hack feeds rules to Mac OS9/Classic and Windows IE5.x+
- High Pass Filter Hack hides files from browsers other than IE6/Win, IE5/Mac, Opera 6, Netscape 6
- Owen Hack hides rules from Opera 6 (but not Opera 7!), Amaya 6;
- Ghost In The Box Hack Makes position:fixed work in IE/Win 6.0
- IE5 Mac Hack Targets only IE 5 Mac
- IE5 Mac Backslash Hack Hides styles from IE 5 Mac except for MSN 8
- Alternate Stylesheet Hack Hides files from Mozilla, Safari, Konqueror 3
- Alpha Beta Png Support Allows cross-browser PNG suport with pure CSS, supports: IE5.5, IE6, Gecko, Opera and kde. All on PC, Linux and MAC. not in Mac opera6 Mac IE5.1
- Child Hack Hides from IE and other less capable browsers
- Max-width in IE Hack Uses expression() to fake max-width for IE/Win 5 and 6
- IE Underscore Hack Feed rules to IE/Win 5+ using underscores in property names
- Pseudo Comment Hack Different rule sets for IE4, IE5.0/5.5 and IE6.0
- Character Escape Hack filters all IE user-agents, due to IE's missing syntax support
Filters