开发者

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

开发者 https://www.devze.com 2023-03-05 00:26 出处:网络
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:

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 -- do开发者_如何转开发es 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/


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

0

精彩评论

暂无评论...
验证码 换一张
取 消