Last Updated: February 25, 2016
·
860
· francisc

CSS Hacks to target various versions of IE

You normally shouldn't do this, but sometimes you have no choice.

selector
{
    /* Other browsers */
    background:#000000;

    /* IE 6 and below. */
    _background:#FF0000;

    /* IE 6 only. */
    /* You can "escape" any letter within the property 
       name which isn't in the range a-f, A-F, 0-9. */
    _bac\kground:#00FF00;

    /* IE 7 and below. */
    *background:#0000FF;

    /* IE8 and below. */
    background:#FFFF00\9;
}