Overview
Usemax-h-* to cap height with the same suffixes used by height and min-height.
| Class | Value | Usage |
|---|---|---|
.max-h-full | 100% | Keep a surface inside the parent height |
.max-h-auto | none | Remove a max-height cap |
.max-h-screen | 100vh | Keep the cap aligned to the viewport |
.max-h-px | 1px | Collapse to a hairline cap |
.max-h-3xs | 16rem / 256px | Small content cap |
.max-h-2xs | 18rem / 288px | Compact panel cap |
.max-h-xs | 20rem / 320px | Small section cap |
.max-h-sm | 24rem / 384px | Sidebar-height cap |
.max-h-md | 28rem / 448px | Reading panel cap |
.max-h-lg | 32rem / 512px | Standard feature cap |
.max-h-xl | 36rem / 576px | Taller feature cap |
.max-h-2xl | 42rem / 672px | Medium shell cap |
.max-h-3xl | 48rem / 768px | Section cap |
.max-h-4xl | 56rem / 896px | Large shell cap |
.max-h-5xl | 64rem / 1024px | Tall feature cap |
.max-h-6xl | 72rem / 1152px | Extra-tall shell cap |
.max-h-7xl | 80rem / 1280px | Largest shipped cap |
Fractional max-heights
| Class | Value | CSS | Usage |
|---|---|---|---|
.max-h-1-2 | 50% | max-height: 50%; | Half of parent height as maximum |
.max-h-1-3 | 33.333% | max-height: 33.333%; | Third-height cap |
.max-h-2-3 | 66.666% | max-height: 66.666%; | Two-thirds cap |
.max-h-1-4 | 25% | max-height: 25%; | Quarter cap |
.max-h-3-4 | 75% | max-height: 75%; | Three-quarters cap |
Scrollable Modal Body
80vh when a modal should stay inside the screen and scroll internally.
Constrained Sidebar Panel
32rem when repeated panels should stay consistent across a layout.
Semantic caps
| Pattern | Role |
|---|---|
Viewport cap (for example 80vh) | Modals, drawers, full-viewport panels |
Fixed cap (for example 32rem) | Repeated panels, sidebars, lists |
Best Practices
- Pair
max-heightwithoverflow-autooroverflow-hiddendeliberately. - Use viewport-relative caps like
80vhfor modals and drawers. - Use fixed caps like
32remfor repeated panels that need consistent rhythm. - Avoid height caps on content that must remain fully visible without scrolling.
Related Utilities
Height
Bundled height utilities
Min Height
Bundled minimum-height helpers
Overflow
Control clipping and scrolling
Custom CSS
Import your own utilities through Skelementor

