Skip to main content

Overview

Max-height utilities cap height with the same suffix families used by height and min-height.

Examples

Using the size scale

Use the t-shirt scale when a surface should stop growing after it reaches a predictable vertical rhythm.

Using a percentage

Use fractional max-height utilities when a child should stay fluid but stop growing beyond a percentage of the parent height.

Keeping content inside the parent

Use maximum-height-full when a child should stay inside the full height of a parent container.

Matching the viewport cap

Use maximum-height-screen when a panel can grow tall but should still stay capped to the viewport height.

Removing a height cap

Use maximum-height-auto when you need to remove a previous max-height constraint and let content grow naturally again.

Best Practices

  • Use maximum-height-<size> for panels that should stop growing after a fixed vertical threshold.
  • Use maximum-height-<fraction> when a child should stay proportional to the parent height.
  • Pair maximum-height-full or maximum-height-screen with overflow utilities when content may need to scroll.
  • Use maximum-height-auto to remove an inherited height cap instead of stacking conflicting rules.

Height

Bundled height utilities

Min Height

Bundled minimum-height helpers