• Shaarli
  • Tag cloud
  • Daily
  • RSS
  • Login
4505 shaares
Filters

Stop Treating CSS Container Queries Like Traditional Media Queries — Smashing Magazine

QRCode

Despite broad browser support, container queries remain surprisingly underused and frequently misunderstood.

A very interesting way to distinguish @media and @container queries is the layout type.

Media queries are for the “macro” layout; they look outward. Stuff like page structure, the header that spans the window, footers, main grid layout, system preferences (prefers-color-scheme), device capabilities (touch screens). You know, anything that is majorly true to the entire page structure.

Container queries, I’d say, are for “micro” layouts, i.e., most things that live inside the “macro” layout. We use them when any content needs to responsively fit whatever space it is allocated. Components that come to mind are things like cards, widgets, forms, navigation, and so on.

In other words, think “page layout” vs. “component layout”.

https://www.smashingmagazine.com/2026/09/stop-treating-css-container-queries-traditional-media-queries/
October 15, 2026 at 10:58:21 AM EDT *
css webdesign
FILLER
Shaarli · The personal, minimalist, super fast, database-free, bookmarking service by the Shaarli community · Documentation
Fold Fold all Expand Expand all Are you sure you want to delete this link? Are you sure you want to delete this tag? The personal, minimalist, super fast, database-free, bookmarking service by the Shaarli community