Height
Set the height for an element.
Widely available
This feature is well established and works across many devices and browser versions.
Chrome
Edge
Firefox
Safari
Usage
16
28
48
<div class="d-f cg-8 c-white"> <div class="d-f ai-c h-16 p-3 bg-indigo">16</div> <div class="d-f ai-c h-28 p-3 bg-indigo">28</div> <div class="d-f ai-c h-48 p-3 bg-indigo">48</div></div>Max Height
Limit the maximum height of an element.
Widely available
This feature is well established and works across many devices and browser versions.
Chrome
Edge
Firefox
Safari
Try changing the vertical size of the box.
64
<div class="d-f o-auto ai-c jc-c max-h-64 min-h-16 p-3 h-32 bg-indigo c-white r-v">64</div>Min Height
Set the minimum height of an element.
Widely available
This feature is well established and works across many devices and browser versions.
Chrome
Edge
Firefox
Safari
Try changing the vertical size of the box.
32
<div class="d-f o-auto ai-c jc-c max-h-64 min-h-16 p-3 h-32 bg-indigo c-white r-v">32</div>Percentages
100%
50%
<div class="d-f b-3 cg-8 h-64 p-2 bc-indigo c-white bs-d"> <div class="d-f ai-c h-full p-3 bg-indigo">100%</div> <div class="d-f ai-c h-half p-3 bg-indigo">50%</div></div>Responsiveness
Use breakpoint prefixes to target different screen sizes. Styles apply from the breakpoint & up.
Target viewport sizes with breakpoint prefixes.
sm:h-*Small≥640px
md:h-*Medium≥768px
lg:h-*Large≥1024px
xxl:h-*Extra Large≥1536px
Hover State
Apply styles conditionally on hover using the h: prefix.
Add the h: prefix to apply styles only when the user hovers over the element.
Syntax:
h:h-*Negative Values
Use negative variants to apply negative height values.
Use the -- syntax to apply negative numeric values.
Syntax:
h--*