Height

Height utilities control how tall an element can be, how it responds to its parent, and how it behaves across responsive breakpoints.

Use them for full-screen sections, fixed-height panels, media previews, scrollable areas, equal-height cards, dashboard shells and responsive vertical layouts.

Quick reference

ClassesPurpose
h-auto, h-full, h-screen, h-min, h-max, h-fitControl native height behavior, full parent height, viewport height and intrinsic content sizing.
h-0, h-px, h-1h-96Set predictable fixed heights from the FrontAlign spacing scale.
min-h-0, min-h-full, min-h-screenSet minimum vertical constraints for layouts that need to grow or shrink safely.
max-h-full, max-h-screen, max-h-48, max-h-64, max-h-96Limit vertical growth for dropdowns, scroll panels, modal bodies, lists and code blocks.
h-1fr4, h-1fr3, h-1fr2, h-2fr3, h-3fr4Size an element as a percentage of a parent with a defined height.
sm:, md:, lg:, xl:, 2xl:Change height behavior from a breakpoint and above.
h-full
fills parent
h-auto
sized by content
min-h-screen
grows past viewport
max-h-24 overflow-y-auto

Content past this point is clipped and becomes scrollable.

capped + scrolls

Usage

Use height utilities directly on any element.

<div class="h-full">
  Full height element
</div>

<section class="min-h-screen">
  Full screen section
</section>

<div class="h-64">
  Fixed height panel
</div>

Height utilities work best when combined with layout utilities such as is-flex, is-grid, place-center, overflow-y-auto, flex-1 and min-h-0.

Core height

Core utilities cover common native CSS height values.

ClassCSS outputPurpose
h-autoheight: auto;Let the browser determine the height.
h-fullheight: 100%;Fill the available parent height.
h-screenheight: 100vh; + height: 100dvh;Match the viewport height with modern mobile viewport support.
h-minheight: min-content;Shrink to the minimum content height.
h-maxheight: max-content;Expand to the maximum content height.
h-fitheight: fit-content;Fit the content while respecting available space.
<section class="h-screen is-flex place-center">
  Full screen hero
</section>

<div class="h-fit">
  Content-sized panel
</div>

Viewport height

h-screen, min-h-screen and max-h-screen use both 100vh and 100dvh.

.h-screen {
  height: 100vh;
  height: 100dvh;
}

.min-h-screen {
  min-height: 100vh;
  min-height: 100dvh;
}

.max-h-screen {
  max-height: 100vh;
  max-height: 100dvh;
}

100vh provides broad fallback behavior. 100dvh improves viewport handling on modern mobile browsers where the browser UI can change the visible viewport height.

Min and max height

Min and max height utilities are useful for full-height layouts, scroll regions and overflow control.

ClassCSS outputUse case
min-h-0min-height: 0;Allow flex or grid children to shrink properly.
min-h-fullmin-height: 100%;Ensure an element is at least as tall as its parent.
min-h-screenmin-height: 100vh; + 100dvhCreate full-screen sections that can grow with content.
max-h-fullmax-height: 100%;Prevent an element from exceeding its parent height.
max-h-screenmax-height: 100vh; + 100dvhLimit an element to the viewport height.
<section class="min-h-screen is-flex place-center">
  Full screen section
</section>

<div class="h-screen is-flex flex-col">
  <header class="h-16">Header</header>
  <main class="min-h-0 flex-1 overflow-y-auto">
    Scrollable content
  </main>
</div>

Fixed height scale

Fixed height utilities are useful for icons, avatars, media previews, cards, panels, skeletons and controlled UI surfaces.

ClassHeightClassHeight
h-00h-px1px
h-10.25remh-82rem
h-20.5remh-102.5rem
h-30.75remh-123rem
h-41remh-164rem
h-51.25remh-246rem
h-61.5remh-6416rem
h-328remh-9624rem
h-71.75remh-205rem
h-4010remh-4812rem
<div class="is-flex align-items-center gap-3">
  <div class="h-12 w-12">Icon</div>
  <div class="h-64">Preview</div>
</div>

Max height scale

Max height utilities limit vertical growth and are useful for scrollable panels, dropdowns, code blocks, lists and modal bodies.

ClassCSS output
max-h-48max-height: 12rem;
max-h-64max-height: 16rem;
max-h-96max-height: 24rem;
<div class="max-h-64 overflow-y-auto">
  Scrollable content
</div>

Fractional heights

Fractional height utilities map common layout fractions to percentages. They are useful when the parent has a defined height.

ClassHeightMeaning
h-1fr425%One quarter of parent height.
h-1fr333.333333%One third of parent height.
h-1fr250%Half of parent height.
h-2fr366.666667%Two thirds of parent height.
h-3fr475%Three quarters of parent height.
25%
h-1fr4
33%
h-1fr3
50%
h-1fr2
67%
h-2fr3
75%
h-3fr4
<div class="h-64">
  <div class="h-1fr2">
    Half height
  </div>
</div>

Full screen hero

Use min-h-screen instead of h-screen when content may grow.

<section class="min-h-screen is-flex place-center">
  <div>
    <h1>Build modern interfaces faster.</h1>
    <p>FrontAlign keeps the section full-height while allowing content to grow.</p>
  </div>
</section>

Media preview

Use fixed heights for media and preview panels.

<div class="h-64 is-flex place-center">
  Preview
</div>

Scrollable panel

Use max-height with overflow utilities for contained scroll areas.

<div class="max-h-64 overflow-y-auto">
  Long content
</div>

Equal height cards

Use Grid or Flexbox with height utilities to create consistent card previews.

<div class="is-grid grid-cols-3 gap-4">
  <article class="h-48">Card</article>
  <article class="h-48">Card</article>
  <article class="h-48">Card</article>
</div>

Dashboard shell

Use min-h-0 when a nested area should be allowed to shrink and scroll inside a fixed-height layout.

<div class="h-screen is-flex flex-col">
  <header class="h-16">Header</header>

  <main class="min-h-0 flex-1 overflow-y-auto">
    Scrollable content
  </main>
</div>

Responsive Class Reference

Base classResponsive variants
h-autosm:h-auto, md:h-auto, lg:h-auto, xl:h-auto, 2xl:h-auto
h-fullsm:h-full, md:h-full, lg:h-full, xl:h-full, 2xl:h-full
h-fitsm:h-fit, md:h-fit, lg:h-fit, xl:h-fit, 2xl:h-fit
min-h-0sm:min-h-0, md:min-h-0, lg:min-h-0, xl:min-h-0, 2xl:min-h-0
min-h-fullsm:min-h-full, md:min-h-full, lg:min-h-full, xl:min-h-full, 2xl:min-h-full
max-h-fullsm:max-h-full, md:max-h-full, lg:max-h-full, xl:max-h-full, 2xl:max-h-full
h-1fr4sm:h-1fr4, md:h-1fr4, lg:h-1fr4, xl:h-1fr4, 2xl:h-1fr4
h-1fr3sm:h-1fr3, md:h-1fr3, lg:h-1fr3, xl:h-1fr3, 2xl:h-1fr3
h-1fr2sm:h-1fr2, md:h-1fr2, lg:h-1fr2, xl:h-1fr2, 2xl:h-1fr2
h-2fr3sm:h-2fr3, md:h-2fr3, lg:h-2fr3, xl:h-2fr3, 2xl:h-2fr3
h-3fr4sm:h-3fr4, md:h-3fr4, lg:h-3fr4, xl:h-3fr4, 2xl:h-3fr4

Responsive variants are mobile-first. A base height applies immediately. A responsive height applies from its breakpoint and above.

<div class="h-auto md:h-full">
  Responsive height
</div>

Height vs min-height

Use height when the element should have a fixed or strict height. Use min-height when the element should be at least a certain height but can grow with content.

Use height forUse min-height for
Media previews and fixed panels.Hero sections with dynamic content.
Icons, avatars and skeletons.Sections that must fill the screen but can expand.
Strict scroll regions.Flexible page layouts.

Notes

  • Use h-screen for strict viewport-height sections.
  • Use min-h-screen when content may grow beyond the viewport.
  • Use max-h-* with overflow-y-auto for scrollable panels.
  • Use min-h-0 to fix overflow inside Flexbox and Grid children.
  • Fractional height utilities require the parent to have a defined height.
  • Responsive height variants follow FrontAlign's mobile-first breakpoint system.

FrontAlign