To specify max width of a view. It prevents the applied value of width
becoming larger than the specified value of max-width
.
The priority of max-width
is higher than width
and min-width
.
<length>
<length>
defines the max-width as an absolute value.
<percentage>
Defines the max-width as a percentage of the containing block's width.
Initial value | no limit |
Applies to | all elements |
Inherited | no |
Animatable | yes |
Percentages | refer to the width of the containing block |
max-width
is higher than width
and min-width
. While in Web, max-width
overrides width
, but min-width
overrides max-width
.max-width
is specified smaller than min-width
, min-width
will be ignored.none
, max-content
, min-content
, fit-content
, min-content
are not supported.LCD tables only load in the browser