What is the different between .class.class
and .class .class
?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
.class .class
matches any elements of class .class
that are descendants of another element with the class .class
.
.class.class
matches any element with both classes.
回答2:
.name1.name2
means a
div
or anelement
having both classes together, for example:<div class="name1 name2">...</div>
.name1 .name2
means a
div
or anelement
which has a classname1
and any of its child nodes having classname2
<div class="name1"> <div class="name2"> ... </div> </div>
回答3:
.class1.class2
Element that has both class1
and class2
set within it's class
attribute (like that: class="class1 class2"
)
.class1 .class2
Element with class2
that is a descendant of an element with class1
class