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.

HTML
<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

ClassCSS declarations
h-12height: 3rem;
h-24height: 6rem;
h-1/2height: 50%;
h-fullheight: 100%;
h-autoheight: auto;
h-screenheight: 100vh;
h-svhheight: 100svh;
h-dvhheight: 100dvh;
h-[7rem]height: 7rem;
View full generated CSS
Compiled 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;
}