[Solved] Is there a difference if I put a space in CSS selectors and if I don’t? [duplicate]


Yes it makes a difference. Using a space is the descendant selector. In your example, anotherClass must be a descendant of someClass.

<div class="someClass">
    <div class="anotherClass"></div>
</div>

Without a space, you are targeting elements that match all classes specified. In your example, matched elements must have both someClass and anotherClass.

<div class="someClass anotherClass">
</div>

1

solved Is there a difference if I put a space in CSS selectors and if I don’t? [duplicate]