Inline-size containmentBaseline · Widely available
The contain: inline-size CSS declaration prevents the element's inline dimension from being set by the element's contents. This permits the browser to avoid slower layout calculations.
Supported in all major browsers for at least 30 months — safe to use without fallbacks. Baseline since Sep 12, 2022. Widely available since Mar 12, 2025.
Browser support
DesktopChrome
1–104Not supported
105+Supportedsince Sep 2, 2022
Current: 155Edge
12–104Not supported
105+Supportedsince Sep 1, 2022
Current: 154Firefox
1–100Not supported
101+Supportedsince May 31, 2022
Current: 157Safari
1–15.6Not supported
16+Supportedsince Sep 12, 2022
Current: 27MobileChrome Android
18–104Not supported
105+Supportedsince Sep 2, 2022
Current: 155Firefox Android
4–100Not supported
101+Supportedsince May 31, 2022
Current: 157Safari iOS
1–15.6Not supported
16+Supportedsince Sep 12, 2022
Current: 27How to use
This feature is Baseline widely available — use it freely, no fallback needed.
Example
Full syntax and examples are on MDN — see the links below.
Feature detection
CSS · check before using
@supports (contain: inline-size) {
/* styles that rely on contain: inline-size */
}
/* or in JavaScript */
if (CSS.supports("contain", "inline-size")) {
// use it
}