fit-content
Widely available
The fit-content
CSS keyword expands a box as needed to fit its contents until the maximum size is reached, preserving the content's preferred aspect ratio.
To learn more, see
fit-content at MDN.
Compatibility
- Chrome 46 Released on 2015-10-13
- Chrome Android 46 Released on 2015-10-14
- Edge 79 Released on 2020-01-15
- Firefox 94 Released on 2021-11-02
- Firefox for Android 94 Released on 2021-11-02
- Safari 11 Released on 2017-09-19
- Safari on iOS 11 Released on 2017-09-19