Browse documentation
Reference / Sizing
Max height
Cap the height of a long panel, menu or list. Combine the cap with an overflow utility to keep every entry reachable.
Working example
- Draft
- Proof
- Bind
Short lists occupy their natural height. Longer lists can scroll once their content reaches the maximum.
<ol tabindex="0" aria-label="Production stages" class="max-h-16 overflow-y-auto border px-2">
<li class="py-1">Draft</li>
<li class="py-1">Proof</li>
<li class="py-1">Print</li>
<li class="py-1">Bind</li>
</ol>Class reference
| Class | CSS declarations |
|---|---|
max-h-16 | max-height: 4rem; |
max-h-32 | max-height: 8rem; |
max-h-full | max-height: 100%; |
max-h-screen | max-height: 100vh; |
max-h-dvh | max-height: 100dvh; |
max-h-none | max-height: none; |
max-h-[10rem] | max-height: 10rem; |
View full generated CSS
.max-h-16 {
max-height: 4rem;
}
.max-h-32 {
max-height: 8rem;
}
.max-h-\[10rem\] {
max-height: 10rem;
}
.max-h-dvh {
max-height: 100dvh;
}
.max-h-full {
max-height: 100%;
}
.max-h-none {
max-height: none;
}
.max-h-screen {
max-height: 100vh;
}