3

What is the difference between

#id .A.B x {  }
#id .A .B  y { }

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?

1 Answer 1

6

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>
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.