CSS Property: max-width
The maximum width of the content area of a box.
As with width
, the maximum width is based on the content area only — any horizontal padding
, border
, or margin
will be in addition.
Possible Values
Value | Note | Example |
---|---|---|
[length] | Should not be a negative value. | 800px |
[percentage] | Calculated in relation to the width of the containing box. Should not be a negative value. | 80% |
none | No maximum width constraint. | |
inherit | ||
initial | ||
unset |
Example
article { max-width: 1024px; }