Cascading Style Sheets/Hacks And Filters

Browser Specific Filters

Opera 10+ CSS Filter

 .dude:read-only { color: green; } 
 .dude:read-write /* form elements */

IE6/IE7 CSS Filter

 @media, { .dude { color: silver;} }

IE7 CSS Filter

 *:first-child+html #mytag to target IE7

IE8 CSS Filter

 @media all { .dude { color: brown\0/; } }

IE9 CSS Filter

 @media all and (monochrome: 0) { .dude { color: pink\9; } }

Webkit CSS Filter

 * > /**/ .dude, x:-webkit-any-link { color:red; } /* * > /**/ hides from IE7; remove if unneeded */

Konqueror CSS Filter

 * > /**/ .dude, x:-khtml-any-link { color:red; }  /* * > /**/ hides from IE7; remove if unneeded */

Safari 2 CSS Filter

 html body:only-child .dude

Firefox CSS Filter

 @-moz-document url-prefix { .dude { color: green; }

Firefox 3.6+ CSS Filter

 @-moz-document url-prefix { @media -moz-scrollbar-start-backward { .dude { color: green; } }

Firefox 3.0+ CSS Filter

 @-moz-document url-prefix { .dude:-moz-system-metric(scrollbar-start-backward) { color: green; } }

Legacy Browser 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 one's code in other browsers or slow down performance. However sometimes it is impossible to avoid the use of all of these hacks.

Be aware that constant browser updates may cause hacks to not work in the future.

  • Caio Hack -- hides rules from Netscape 4, even 'inline' CSS

  This article uses material from the Wikipedia page available here. It is released under the Creative Commons Attribution-Share-Alike License 3.0.


Manage research, learning and skills at IT1me. Create an account using LinkedIn to manage and organize your IT knowledge. IT1me works like a shopping cart for information -- helping you to save, discuss and share.

  Contact Us  |  About |  IT Training & References |  IT Careers |  IT Hardware |  IT Software |  IT Books