HTML & CSS · Middle · Question 26 of 75

What does the selector .card:has(img) match?

Explanation

:has() is the "parent selector": it matches an element if something inside it (or next to it, with + and ~ combinators) matches the argument. The card itself is styled, not the image. Examples: form:has(:invalid), label:has(+ input:checked). Attributes are selected with [attr].

Further reading

Problem with a question

HTML & CSS · Middle · question 26

Test yourself

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

Take this quiz