Size containment
Widely available since 2024-09-14
The contain: size
CSS declaration sets an element's dimensions exclusively by its height
and width
properties, ignoring its contents and descendants. This permits the browser to avoid slower layout calculations.
Learning resources on MDN
Browser support
- Chrome 52 Released on 2016-07-20
- Chrome Android 52 Released on 2016-07-27
- Edge 79 Released on 2020-01-15
- Firefox 69 Released on 2019-09-03
- Firefox for Android 79 Released on 2020-07-28
- Safari 15.4 Released on 2022-03-14
- Safari on iOS 15.4 Released on 2022-03-14