Discuss CSS MAX Width and Height?

The max-width CSS property sets the maximum width of an element. It prevents the used value of the width property from becoming larger than the value specified by max-width.

  • None- No maximum width. This is default
  • Length- Defines the maximum width in px, cm, etc. Read about length units
  • %- Defines the maximum width in percent of the containing block
  • Initial- Sets this property to its default value. Read about initial
  • Inherit- Inherits this property from its parent element. Read about inherit

The max-height CSS property sets the maximum height of an element. It prevents the used value of the height property from becoming larger than the value specified for max height.

  • None- No maximum height. This is default
  • Length- Defines the maximum height in px, cm, etc. Read about length units
  • %- Defines the maximum height in percent of the containing block
  • Initial- Sets this property to its default value. Read about initial
  • Inherit- Inherits this property from its parent element. Read about inherit