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
Usemaximum-height-full when a child should stay inside the full height of a parent container.
Matching the viewport cap
Usemaximum-height-screen when a panel can grow tall but should still stay capped to the viewport height.
Removing a height cap
Usemaximum-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-fullormaximum-height-screenwith overflow utilities when content may need to scroll. - Use
maximum-height-autoto remove an inherited height cap instead of stacking conflicting rules.
Related Utilities
Height
Bundled height utilities
Min Height
Bundled minimum-height helpers

