Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there any way to get IE8 to not ignore a CSS rule that it only partially understands?

I just ran into what seems like absurd behavior to me. If IE8 doesn't understand part of a rule it ignores the entire thing:

input[type=radio]:checked,
input.checked {
    /* Some CSS */
}

I already have IE8 specific JS adding the .checked class, but because it doesn't understand :checked, it ignores the entire thing, so I'm forced to now have several rules:

input[type=radio]:checked{
    /* Some CSS */
}
input.checked {
    /* The exact same CSS */
}

So my question -- does anyone know of a way to get IE8 and below to ignore the :checked instead of throwing out the entire rule?

Very basic example: http://jsfiddle.net/8UT56/

like image 484
Nobody Avatar asked May 11 '11 18:05

Nobody


1 Answers

You can use a library like http://selectivizr.com/ to give IE newer selectors.

like image 65
Rich Bradshaw Avatar answered Jan 02 '23 10:01

Rich Bradshaw