max-width

The max-width property sets the maximum width of an element. The element's width value will be calculated depending on the values of the set width, max-width and min-width properties. If the width value is greater than the max-width value, then the element's width is taken equal to the max-width value.

Syntax



max-width: [ [length | percentage] || [border-box | content-box] ] | available | min-content | max-content | fit-content | none;