The max-width property in CSS is used to define the maximum width of an element. The value of the width cannot be larger than the value by max-width. If the content is larger then the max-width then it will go to the next line and if the content is smaller then max-width then it has no effect.
max-width property defines the maximum width of an element.
If the content is larger than the maximum width, it will automatically change the height of the element.
If the content is smaller than the maximum width, the
has no effect.
Note: This prevents the value of the
width property from becoming larger than
max-width. The value of the
max-width property overrides
the width property.
Supported Browsers: The browser supported by property are listed below: