开发者

Css class nesting and grouping

What is the difference between

#id .A.B x {  }
#id .A .B  y { }
开发者_如何学JAVA

in CSS file?

Both A and B are classes. x and y are some tags

Does the spacing between .A and .B have any significance?


In the first case, it references an element that has both A and B as classes:

<div class="A B"></div>

The second is an element with class A that has an element with class B nested inside:

<div class="A">
  <div class="B"></div>
</div>
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜