Browse documentation
Reference / Sizing
Height
Set an explicit block height using the spacing scale, a percentage, a viewport unit or a custom value.
Working example
Percentage heights need a definite height on their containing block. The parent here establishes that height with h-24.
<div class="flex h-24 items-end gap-3 border-b">
<div class="h-1/2 w-12 bg-neutral-400" aria-label="Half-height block"></div>
<div class="h-full w-12 bg-black" aria-label="Full-height block"></div>
</div>Class reference
| Class | CSS declarations |
|---|---|
h-12 | height: 3rem; |
h-24 | height: 6rem; |
h-1/2 | height: 50%; |
h-full | height: 100%; |
h-auto | height: auto; |
h-screen | height: 100vh; |
h-svh | height: 100svh; |
h-dvh | height: 100dvh; |
h-[7rem] | height: 7rem; |
View full generated CSS
.h-1\/2 {
height: 50%;
}
.h-12 {
height: 3rem;
}
.h-24 {
height: 6rem;
}
.h-\[7rem\] {
height: 7rem;
}
.h-auto {
height: auto;
}
.h-dvh {
height: 100dvh;
}
.h-full {
height: 100%;
}
.h-screen {
height: 100vh;
}
.h-svh {
height: 100svh;
}