CSS max-width property
Description of property definition and use
The max-width property sets the maximum width of the element.
Note: Max-width properties do not include padding, borders, or margins!
Default: | none |
---|---|
Inherited: | no |
Version: | CSS2 |
JavaScript syntax: | object .style.maxWidth="100px" |
Browser support
The numbers in the table support the first browser version number of the property.
Attributes | |||||
---|---|---|---|---|---|
max-width | 1.0 | 7.0 | 1.0 | 2.0.2 | 7.0 |
The property value
Value | Describe |
---|---|
none | Default. The definition has no limit on the maximum width of the element. |
length | Defines the maximum width value of an element. |
% | Defines the maximum width based on the percentage of block-level objects that contain it. |
inherit | Specifies that the value of the max-width property should be inherited from the parent element. |
Related articles
CSS tutorial: CSS Dimension
CSS Reference Manual: min-width property