Container queries
Container queries enable you to apply styles to an element based on certain attributes of its container:
- The container’s size.
- Styles applied to the container.
- The container’s scroll-state or that of its scrolling ancestor.
Container queries are an alternative to media queries, which apply styles to elements based on viewport size or other device characteristics.