CSS contain-intrinsic-width Property
Description
The contain-intrinsic-width property provides a hint to the user agent about an element's intrinsic inline size (width) to be used when CSS containment prevents the browser from computing that size from the element’s normal contents. When an element is subject to containment, the rendering engine may not be allowed to inspect descendants to determine intrinsic dimensions; this property supplies a fallback intrinsic width so layout algorithms can proceed without expensive layout reads. It’s a tool for stabilizing layout decisions and avoiding layout jumps when content is hidden behind containment boundaries.
Because the value acts as an intrinsic-size hint rather than an absolute override, it is consulted by the browser during intrinsic sizing and min/max calculations. The hint is used by the algorithms that compute min-content, max-content and preferred sizes, which in turn affect how an element participates in flex, grid and block formatting contexts. This property is most useful where the UA needs an intrinsic inline size but containment or replaced content prevents deriving one directly; it works alongside containment behavior controlled by contain and should be thought of as part of the same containment/intrinsic-size toolset.
In practical terms, contain-intrinsic-width pairs naturally with vertical intrinsic hints such as contain-intrinsic-height and with aspect-ratio constraints like aspect-ratio. When an aspect ratio or the paired intrinsic height is present, the UA can reconcile the width hint with those constraints to produce consistent used sizes. Author-supplied intrinsic hints are particularly helpful for images, iframes or components rendered off-thread (or hydrated later) because they let you reduce content reflow without resorting to explicit sizing. If you already set explicit box sizes, the hint is simply an aid to intrinsic calculations and does not supersede explicit rules such as width or height, but it can significantly improve stability and performance when used appropriately.
Definition
- Initial value
- none
- Applies to
- elements for which size containment can apply
- Inherited
- no
- Computed value
- as specified, with lengths values computed
- Animatable
- by computed value type
- JavaScript syntax
- object.style.containIntrinsicWidth
Syntax
contain-intrinsic-width: auto? [ none | <length> ]
Values
- auto? [ none | <length> ]If auto is specified and the element has a last remembered size and is currently skipping its contents, its explicit intrinsic inner size in the corresponding axis is the last remembered size in that axis. Otherwise, the corresponding axis either doesn’t have an explicit intrinsic inner size (if none is specified) or has an explicit intrinsic inner size of the specified <length>.
Example
Browser Support
The following information will show you the current browser support for the CSS contain-intrinsic-width property. Hover over a browser icon to see the version that first introduced support for this CSS property.
This property is supported by all modern browsers.
Desktop
Tablets & Mobile
Last updated by CSSPortal on: 1st January 2026
