Web features explorer

fit-content

Widely available
Tags: css Groups: CSS > Layout

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