尺寸

最小高度min-height

Setting the minimum height of an element.

Overview

ClassDeclarations
min-vhmin-height: 100vh;
min-h:fullmin-height: 100%;
min-h:fitmin-height: fit-content;
min-h:minmin-height: min-content;
min-h:maxmin-height: max-content;
min-h:3xsmin-height: var(--container-3xs);
min-h:2xsmin-height: var(--container-2xs);
min-h:xsmin-height: var(--container-xs);
min-h:smmin-height: var(--container-sm);
min-h:mdmin-height: var(--container-md);
min-h:lgmin-height: var(--container-lg);
min-h:xlmin-height: var(--container-xl);
min-h:2xlmin-height: var(--container-2xl);
min-h:3xlmin-height: var(--container-3xl);
min-h:4xlmin-height: var(--container-4xl);
min-h:5xlmin-height: var(--container-5xl);
min-h:6xlmin-height: var(--container-6xl);
min-h:7xlmin-height: var(--container-7xl);
min-h:<size>min-height: <size>;

Examples

Set a baseline height

Use min-h:* when content may grow but the region still needs a minimum block size.

<section class="min-h:48x">    ...</section>
Generated CSS
@layer utilities {    .min-h\:48x {        min-height: 12rem    }}

Build viewport sections

Use native viewport units for full-screen or near full-screen layouts.

<main class="min-h:100dvh">    ...</main>

100dvh follows the dynamic viewport size on modern mobile browsers. Use min-vh when the legacy 100vh value is the intended cap.

Let content define the final size

Unlike h:*, a minimum height does not clip or force overflow by itself. It establishes a floor, then lets content expand the element.

<article class="min-h:32x overflow:visible">    ...</article>

Apply conditionally

Apply styles based on different states using selectors and conditional queries.

<div class="min-h:32x min-h:100dvh@sm min-h:0@print">...</div>

Use height when the element should have an exact height.


  • Master UI


© 2026 Aoyue Design LLC.MIT License
Trademark Policy