The fit-content
keyword is equivalent to fit-content(stretch)
. In practice, this means that the box will use the available space, but never more than max-content
.
When used as laid out box size for width
, height
, min-width
, min-height
, max-width
and max-height
the maximum and minimum sizes refer to the content size.
The interpolate-size
property and calc-size()
function can be used to enable animations to and from fit-content
.
Note: The CSS Sizing specification also defines the fit-content()
function. This page details the keyword.