HTML & CSS · Middle · Question 32 of 75
What are @container container queries for?
- ✓Correct answer: To make a component's styles depend on its container's size, not the window
- 2To limit the page's maximum width and center it
- 3It's the new name for
@media, which is now deprecated
Explanation
Media queries look at the viewport, but a component may sit in a narrow sidebar or a wide column. Container queries let a card adapt to its actual space: the parent gets container-type: inline-size, and styles use @container (width > 400px) { ... }. @media is not deprecated.