What's the support for .className.andClassName in the current browsers?

╄→尐↘猪︶ㄣ 提交于 2020-01-06 12:46:11

问题


Confusing title? Sure!

In CSS, you can specify:

.button.blue {
    ...
}

Which will target elements that have both class names.

Does anyone know what the browser support is?


回答1:


I've never seen chaining of modifiers fail. I think you're good to go in all browsers still in use today, if not all browsers that ever implemented CSS.

EDIT: Nope. Just watched IE6 choke on it. Plugged this example into Adobe Browserlab, and both the class attributes hello world and world respond to the .hello.world selectors.

Booooo, IE6. IE7 is good to go on that point, though.

Here's a blog post describing the issue (IE just reads the last class, it would seem), and offering the following stupid but necessary fix if IE6 is required: <p class="one two one-two">



来源:https://stackoverflow.com/questions/3939105/whats-the-support-for-classname-andclassname-in-the-current-browsers

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!