Easy Tutorial
❮ Css3 Pr Transition Duration Pr Background Image ❯

CSS max-width Property

Example

Set the maximum width of a paragraph:


Property Definition and Usage

The max-width property sets the maximum width of an element.

Note: The max-width property does not include padding, border, or margin!

Default value: none
Inherited: no
--- ---
Version: CSS2
--- ---
JavaScript syntax: object.style.maxWidth="100px"
--- ---

Browser Support

The numbers in the table specify the first browser version that fully supports the property.

Property
max-width 1.0 7.0 1.0 2.0.2 7.0

Property Values

Value Description
none Default. No maximum width is specified for the element.
length Defines the maximum width value of the element.
% Defines the maximum width as a percentage of the containing block's width.
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: min-width Property

❮ Css3 Pr Transition Duration Pr Background Image ❯