HTML & CSS · Senior · Question 3 of 75

What does @scope (.card) to (.card__content) { img { ... } } do?

Explanation

@scope defines a scope root and an optional "lower boundary" (donut scope): styles apply inside .card but don't reach into .card__content and its descendants. In addition, with equal specificity the rule with the closer root wins (scoping proximity). @scope doesn't create a Shadow DOM.

Further reading

Problem with a question

HTML & CSS · Senior · question 3

Test yourself

Take the HTML & CSS · Senior quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz