CSS container queries
type: TechArticle
description: Style a component by the space it is actually given with container-type and @container — responsive design that follows the container, not the viewport — and test a container's own custom properties with style queries.
language: en
is part of: Web Specification Studio
author: Web Specification Studio
publisher: Web Specification Studio
license: https://creativecommons.org/licenses/by/4.0/
date modified: 2026-06-27T00:00:00.000Z
citation: CSS Containment Module Level 3
  type: CreativeWork
  publisher: W3C CSS Working Group
citation: CSS Conditional Rules Module Level 5 — style queries
  type: CreativeWork
  publisher: W3C CSS Working Group
citation: MDN — @container
  type: CreativeWork
  publisher: MDN

Web Specification Studio
type: WebSite

Web Specification Studio
type: Organization

breadcrumb
type: BreadcrumbList
item list element: Home
  type: ListItem
  position: 1
  item: https://webspecification.com/
item list element: Spec
  type: ListItem
  position: 2
  item: https://webspecification.com/spec/
item list element: Foundations
  type: ListItem
  position: 3
  item: https://webspecification.com/spec/foundations/
item list element: CSS container queries
  type: ListItem
  position: 4
  item: https://webspecification.com/spec/foundations/container-queries/