Monday, September 06, 2004

Internet Explorer Hacks (CSS)

The following shows how you can hide/show CSS for certain versions of Internet Explorer (works when page is in standards mode - i.e. DOCTYPE at top of page):

mytag {
	/* all browsers */
	property: value;
	/* IE only browsers */
	_property: value;
	/* ignored by IE 5, works in IE 5.5/6 */
	property /**/: value;
	/* ignored by IE 5.5, works in IE 5/6 */
	property/**/: value;
	/* ignored by IE 6, works in IE 5/5.5 */
	property: /**/value;
	/* all browsers */
	property2: value;
	/* voice-family hack - any code after 'voice-family' not recognised by IE5/5.5 */
	voice-family: "\"}\"";
	voice-family: inherit;
	property2: newvalue;
}

CSS Filters also lists many filters for delivering certain CSS to different browsers.

Edit: CSS Filters link, more IE filtering methods - so you can serve different CSS to IE 5 / 5.5 and 6

No comments: