Sizing
Utilities for setting the minimum height of an element.
Class | Styles |
---|---|
min-h-<number> | min-height: calc(var(--spacing) * <number>); |
min-h-<fraction> | min-height: calc(<fraction> * 100%); |
min-h-auto | min-height: auto; |
min-h-none | min-height: none; |
min-h-px | min-height: 1px; |
min-h-full | min-height: 100%; |
min-h-screen | min-height: 100vh; |
min-h-dvh | min-height: 100dvh; |
min-h-dvw | min-height: 100dvw; |
min-h-lvh | min-height: 100lvh; |
min-h-lvw | min-height: 100lvw; |
min-h-svw | min-height: 100svw; |
min-h-svh | min-height: 100svh; |
min-h-min | min-height: min-content; |
min-h-max | min-height: max-content; |
min-h-fit | min-height: fit-content; |
min-h-(<custom-property>) | min-height: var(<custom-property>); |
min-h-[<value>] | min-height: <value>; |
Use min-h-<number>
utilities like min-h-24
and min-h-64
to set an element to a fixed minimum height based on the spacing scale:
Use min-h-full
and min-h-<fraction>
utilities like min-h-1/2
, and min-h-2/5
to give an element a percentage-based minimum height:
Use the min-h-[<value>]
syntax to set the minimum height based on a completely custom value:
<div class="min-h-[220px] ..."> <!-- ... --></div>
For CSS variables, you can also use the min-h-(<custom-property>)
syntax:
<div class="min-h-(--my-min-height) ..."> <!-- ... --></div>
This is just a shorthand for min-h-[var(<custom-property>)]
that adds the var()
function for you automatically.
Prefix a min-height
utility with a breakpoint variant like md:
to only apply the utility at medium screen sizes and above:
<div class="h-24 min-h-0 md:min-h-full ..."> <!-- ... --></div>
Learn more about using variants in the variants documentation.
The min-h-<number>
utilities are driven by the --spacing
theme variable, which can be customized in your own theme:
@theme { --spacing: 1px; }
Learn more about customizing the spacing scale in the theme variable documentation.