programming.torensma.net: Code Snippets

CSS hacks

-property
Prepending a property with a non-alphanumeric character like – (or underscore) will cause most browser to ignore that line. Internet Explorer 6 and earlier however do apply the rule.

*property
The previous issue was fixed in Internet Explorer 7, but properties with an asterix(*) immediatly before its name are applied in IE 7.

Examples:

border: 1px solid red; /* applied in all browsers */
-border: 1px solid green; /* applied in IE 4,5,6 -- not in 7 */
*border: 1px solid blue; /* applied in IE 7 */

You can follow any responses to this entry through the RSS 2.0 feed.