The best CSS max-width property Tutorial In 2024, In this tutorial you can learn Examples,Attribute definitions and instructions,Browser Support,Property Value,related articles,
Setting the maximum width of the paragraph:
max-width property sets the maximum width of an element.
Note: max-width attribute does not include padding, borders, or margins!
Defaults: | none |
---|---|
inherit: | no |
version: | CSS2 |
JavaScript syntax: | object .style.maxWidth = "100px" |
Figures in the table represent the first browser to support the version number of the property.
属性 | |||||
---|---|---|---|---|---|
max-width | 1.0 | 7.0 | 1.0 | 2.0.2 | 7.0 |
value | description |
---|---|
none | default. There is no limit on the definition of the maximum width of the element. |
length | The maximum width value defines the element. |
% | Definition is based on the percentage of the containing block-level object maximum width. |
inherit | Provisions should inherit the value max-width attribute from the parent element. |
CSS tutorial: CSS a Dimension
CSS Reference: min-width attribute