max-height

Table of contents

    1. 1.1. Summary
    2. 1.2. Syntax
    3. 1.3. Values
    4. 1.4. Examples
    5. 1.5. Notes
    6. 1.6. Specifications
  1. 2. Browser compatibility
    1. 2.1. See also
Table of contents
    1. 1.1. Summary
    2. 1.2. Syntax
    3. 1.3. Values
    4. 1.4. Examples
    5. 1.5. Notes
    6. 1.6. Specifications
  1. 2. Browser compatibility
    1. 2.1. See also

« CSS « CSS Reference

Summary

The max-height CSS property is used to set the maximum height of a given element. It prevents the used value of the height property from becoming larger than the value specified for max-height.

Syntax

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

Values

<length>
A fixed maximum height. See <length> for possible units.
<percentage>
The <percentage> is calculated with respect to the height of the containing block. If the height of the containing block is not specified explicitly, the percentage value is treated as none.
none
No limit on the height of the box.

Examples

View Live Examples (not available, please check later)

table { max-height: 75%; }

form { max-height: none; }

Notes

max-height overrides height, but min-height overrides max-height .

Specifications

Browser compatibility

  • Desktop
  • Mobile

Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari
Basic support 1.0 1.0 (1.7 or earlier) 7.0 7.0 1.0
Feature Android Firefox Mobile (Gecko) IE Phone Opera Mobile Safari Mobile
Basic support 1.0 1.0 (1) 6.0 6.0 1.0

Tags (2)

Edit tags

Attachments (0)

 

Attach file