Sizing
5.10
Lesson

Maximum Width

The max-width property is used to define the maximum width of an element.

If the content is larger than the defined value, the height of the element increases to make space.

When both max-width and width are defined, the least of the two values is applied, as can be seen in the code examples given below: