CSS container query units (cqw, cqh, cqi, cqb, cqmin, cqmax) work in Chrome 105+, Edge 105+, Firefox 110+, Safari 16+, Opera 91+, Samsung Internet 20+.

Prince Dewani
May 5, 2026
CSS container query units are W3C CSS length units (cqw, cqh, cqi, cqb, cqmin, cqmax) that size values relative to a parent container, not the viewport. They work in Chrome 105+, Edge 105+, Firefox 110+, Safari 16+ on macOS and iOS, Opera 91+, and Samsung Internet 20+, while Internet Explorer never added support.
This guide covers what they are, the browsers that support them, the six available units, how to use them, and the known issues.
CSS container query units are six relative length units defined in the W3C CSS Conditional Rules Module Level 5: cqw, cqh, cqi, cqb, cqmin, and cqmax. Each unit equals one percent of a parent query container's width, height, inline size, block size, smaller axis, or larger axis.
CSS container query units work in every browser that supports CSS container queries, with Chrome and Edge first in version 105, Safari in version 16, and Firefox in version 110.
Chrome supports CSS container query units from Chrome 105 on Windows, macOS, Linux, ChromeOS, and Android. Chrome 93 to 100 had cqw, cqh, cqi, and cqb behind the chrome://flags/#enable-container-queries flag, and Chrome 4 to 92 did not parse any cq length unit. All six units (cqw, cqh, cqi, cqb, cqmin, cqmax) ship in the same Chrome 105 release.
Microsoft Edge supports CSS container query units from Edge 105 on Windows, macOS, Linux, and Android. The feature is on by default with no flag, since Edge tracks the Chromium 105 base. Edge 12 to 104 did not parse cqw, cqh, cqi, cqb, cqmin, or cqmax.
Firefox supports CSS container query units from Firefox 110 on Windows, macOS, Linux, and Android. No flag is required. Firefox 2 to 109 did not parse cqw, cqh, cqi, cqb, cqmin, or cqmax, so any rule that used them was discarded by the parser.
Safari supports CSS container query units from Safari 16 on macOS Ventura and from Safari 16 on iOS and iPadOS. The desktop and mobile builds ship the same six units together (cqw, cqh, cqi, cqb, cqmin, cqmax). Safari 3.1 to 15.6 on macOS and Safari on iOS before version 16 did not support any cq length unit.
Opera supports CSS container query units from Opera 91 on Windows, macOS, Linux, and Android, mirroring the Chromium 105 base. Opera 79 to 90 had the units behind the same enable-container-queries flag as Chrome, and earlier Opera versions did not parse them. Opera Mobile 80 and later support cqw, cqh, cqi, cqb, cqmin, and cqmax on Android.
Samsung Internet supports CSS container query units from Samsung Internet 20 on Galaxy phones and tablets. Samsung Internet 4 to 19 did not parse cqw, cqh, cqi, cqb, cqmin, or cqmax. The browser tracks the Chromium 105 base for parity with desktop Chrome.
The Chromium-based Android Browser supports CSS container query units from version 105, matching desktop Chrome. The legacy stock Android Browser, frozen at Android 4.4, does not parse any cq length unit. Use Chrome for Android, Firefox for Android, or Samsung Internet on modern Android phones for full cqw, cqh, cqi, cqb, cqmin, and cqmax support.
Internet Explorer never added support for CSS container query units. IE 5.5 through IE 11 do not recognize cqw, cqh, cqi, cqb, cqmin, or cqmax, and any rule that uses them is discarded by the parser. Microsoft has retired Internet Explorer 11 and recommends Edge for any site that needs container query units.
Note: CSS container query units fall back to the small viewport unit when the parent container is missing container-type, and the trap fires differently in Safari, Firefox, and Chrome. Test cqw, cqh, cqi, and cqb on real browsers and OS with TestMu AI. Try TestMu AI free!
The CSS Conditional Rules Module Level 5 defines six container query length units. Each unit measures one percent of a parent container's width, height, inline size, block size, smaller axis, or larger axis, and falls back to the small viewport unit on its axis when no eligible container is found.
Container query units only resolve inside a query container, so the parent must declare container-type before any cq value works. Once the container is declared, any descendant can use cqw, cqh, cqi, cqb, cqmin, or cqmax in place of vw or vh.
/* Step 1: Declare a container on the parent */
.product-card {
container-type: inline-size;
container-name: card;
}
/* Step 2: Use cq units so children scale with the card, not the viewport */
.product-card h2 {
font-size: clamp(1rem, 4cqi, 1.5rem);
padding-inline: 2cqi;
}
.product-card .thumbnail {
width: 100cqw;
aspect-ratio: 16 / 9;
}
/* Step 3: Combine cq units with @container size queries for layout shifts */
@container card (min-width: 480px) {
.product-card {
display: grid;
grid-template-columns: 40cqi 1fr;
gap: 2cqi;
}
}If a cq value resolves to the viewport instead of the container, container-type is missing on the closest ancestor; the closest container with container-type wins, so check the cascade in DevTools.
CSS container query units are stable across modern browsers, but the spec has a few traps that catch teams the first time they ship cq values in production.
In my experience, the small-viewport fallback bites teams the most. A card that renders correctly on a desktop preview suddenly looks giant inside a 320px sidebar, because the inline-size container higher up the tree got removed during a refactor and every cqi value silently switched to svi. The fix is to add a regression test that asserts a known cqw value matches the parent width, not the viewport.
All CSS container query unit version numbers and platform notes in this guide come from these primary sources:
Did you find this page helpful?
More Related Hubs
TestMu AI forEnterprise
Get access to solutions built on Enterprise
grade security, privacy, & compliance