IE9 Only CSS Hack

#element {
color:orange;
}
#element {
*color: white; /* IE6+7, doesn't work in IE8/9 as IE7 */
}
#element {
_color: red; /* IE6 */
}
#element {
color: green/IE8+9; /* IE8+9 */
}
:root #element { color:pink /IE9; } /* IE9 */

Advertisements

Posted on November 13, 2011, in Web Dev and tagged . Bookmark the permalink. 4 Comments.

  1. Subha Balakrishnan

    Hi,
    when i applied the IE9 css hack which you have given is not working.

  2. Subha Balakrishnan

    Hi Jade,

    I got the IE9 css hack and now its working fine in IE9 only

    The css hack is

    #element{
    padding-right: 22px /IE9;
    }

  3. Hi Jade,
    Can the hacks be given if there is only one style present in the css?
    Consider this
    .abc{
    padding: 0 3px 4px 5px;
    padding-right : 22px /IE9;
    }
    Is this a correct way of using it?
    Thanks

  4. Arul,

    I think you need to repeat the same property:

    padding: 0 3px 4px 5px;
    padding: 0 22px 4px 5px /IE9;

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: