Height
Utilities for setting the height of an element.
Show all classes
Use or h-px
to set an element to a fixed height.
Full height
Use h-full
to set an element’s height to 100% of its parent, as long as the parent has a defined height.
<div class="h-48">
<div class="h-full ...">
<!-- This element will have a height of `12rem` (h-48) -->
</div>
</div>
Hover, focus, and other states
Tailwind lets you conditionally apply utility classes in different states using variant modifiers. For example, use hover:h-full
to only apply the h-full
utility on hover.
<!-- ... -->
</div>
For a complete list of all available state modifiers, check out the documentation.
You can also use variant modifiers to target media queries like responsive breakpoints, dark mode, prefers-reduced-motion, and more. For example, use md:h-full
to apply the h-full
utility at only medium screen sizes and above.
To learn more, check out the documentation on , Dark Mode and .
Customizing your theme
By default, Tailwind’s height scale is a combination of the default spacing scale as well as some additional values specific to heights.
tailwind.config.js
theme: {
extend: {
'128': '32rem',
}
}
}
}
To customize height separately, use the theme.height
section of your tailwind.config.js
file.
tailwind.config.js
Learn more about customizing the default theme in the documentation.
If you need to use a one-off height
value that doesn’t make sense to include in your theme, use square brackets to generate a property on the fly using any arbitrary value.
<div class="h-[32rem]">