Coding task · HTML and CSS course · Module 9: Modern CSS
Adaptive Container Queries
Container Queries respond to the parent's size, not the window! Use container-type: inline-size on the parent, then @container (min-width: 400px) { } for children. Perfect for reusable components - like hieroglyphs on different surfaces!
Task
Create .card-container { container-type: inline-size }. Inside, add a .card that changes flex-direction from column to row at @container (min-width: 300px). Place it at different widths - the card will adapt!