lime icon

Phosphorus and Lime

A Developer's Broadsheet

This blog has been deprecated. Please visit my new blog at klenwell.com/press.
CSS: IE-specific styles
I thought I has already posted something on this, but I guess not. Found a couple simple ones

hanging comma hack
.ie_only,
{
background:blue;
}

source: andcuriouser.com

underscore hack (applied to the attribute)
.ie_only
{
text-align:left;
_text-align:center; /* IE only */
}

source: wellstyled.com

The inverse (to apply a rule selectively to non-IE browsers -- not sure if it's Mozilla-specific or CSS2-specific or just IE-specific or what):

html>body hack
html>body .not_IE
{
text-align:left;
}


keywords: CSS, stylesheet, hack, conditional, IE, ie, browser-specific