本文介绍了在当前浏览器中对.className.andClassName的支持是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



在CSS中,您可以指定:


$ b

  .button.blue {
...
}

这将定位具有 两个 类名称的元素。



有谁知道浏览器支持的是什么?

解决方案

>我从来没有见过链接修饰符失败。



编辑:不适用于所有尚未使用的浏览器。只是看着IE6窒息了。将插入到Adobe Browserlab中,并将类属性 hello world world 响应 .hello.world 选择器。 b

Booooo,IE6。



这里有一个描述问题(IE只读最后一个类,它似乎),并提供以下愚蠢但必要的修复如果需要IE6:< p class =one two one-two>


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?

解决方案

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">

这篇关于在当前浏览器中对.className.andClassName的支持是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-22 09:08