Is there any way to get IE8 to not ignore a CSS ru

2019-04-23 20:24发布

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/

1条回答
Viruses.
2楼-- · 2019-04-23 20:47

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

查看更多
登录 后发表回答