Archive for the ‘Blog’ Category

Browser-specific CSS hacks

Monday, October 19th, 2009

I don’t use CSS hacks anymore. Instead I use IE’s conditional comments to apply classes to the body tag.

Nonetheless, I wanted to document every browser-specific css selector and style attribute hack I’ve seen. Plus there’s no way to provide stylesheets to only Safari, I believe.

So here are go:

/***** Selector Hacks ******/

/* IE6 and below */
* html #uno { color: red }

/* IE7 */
*:first-child+html #dos { color: red } (more…)