CodeZettaInterview Hub

CSS · Selectors · Fresh / Intern · Comparison

What is the difference between .a .b and .a.b?

Short Interview Answer

Descendant combinator vs AND on the same element.

Detailed Explanation

.a .b matches .b inside .a. .a.b matches an element with both classes.

Example

/* .card .title vs .card.featured */

Did you know this answer?