Container queries
Container queries style a component based on the size of its container instead of the whole screen.
Definition
Container queries style a component based on the size of its container instead of the whole screen.
Use case
A card can stack inside a narrow sidebar and sit side by side in the main column, with no change to its code.
Related terms
Documentation
CSS container queries
Shows how to set up a container and write rules against its size.