HTML & CSS · Senior · Question 31 of 75
What does native CSS nesting (&) give you?
.card {
padding: 1rem;
&:hover { background: #eee; }
.title { font-weight: 600; }
}- 1Nothing: without Sass or PostCSS this code is invalid in the browser
- ✓Correct answer: Browsers understand nesting natively;
&refers to the parent selector - 3Nested rules apply only to direct children of
.card
Explanation
CSS Nesting is supported by all modern browsers. Differences from Sass: nested selectors behave as if wrapped in :is(), which affects specificity, and you can't concatenate strings like &__title - that's a preprocessor-only feature.