MDN self-hosted library · e01.org

CSSContainerRule: conditions property

Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.

js
({ name: "<container-name>", query: "<container-query>" });
css
@container sidebar (width >= 700px), (height >= 400px) {
  /* Styles */
}
js
[
  { name: "sidebar", query: "(width >= 700px)" },
  { name: "", query: "(height >= 400px)" },
];