1. Home
  2. Computing & Technology
  3. Web Design / HTML

max-height

By Jennifer Kyrnin, About.com

max-height Description:

The max-height property defines largest height that an element should have.

max-height in CSS Versions:

max-height Syntax:

max-height: <length> | <percentage> | none | inherit

  • <length>
    The height is defined by a fixed measure.
  • <percentage>
    The height is defined by a percentage of the containing block's height.
  • none
    No limit on the height of the box.
  • inherit
    The element should have the same max-height setting as the parent.

max-height Initial Value:

none

max-height Applies To:

All elements but non-replaced inline elements, table columns, and column groups.

max-height Inheritance:

This property is not inherited.

max-height Browser Support:

max-height media type:

  • Visual

max-height Examples:

A paragraph with a max-height

<p style="max-height: 100px;">
This paragraph will not be more than 100 pixels high.
</p>

max-height Special Notes:

  • Internet Explorer 6 does not support this property.
  • Make sure you define the overflow property if you want the contents to be clipped from an element that is larger than expected.
  • Also remember that setting limits on the size of elements can cause accessibility problems.

More max-height Information

Return to the Style Library

Explore Web Design / HTML

More from About.com

  1. Home
  2. Computing & Technology
  3. Web Design / HTML
  4. CSS
  5. Style Properties
  6. CSS Style Property: max-height

©2008 About.com, a part of The New York Times Company.

All rights reserved.