h-auto: Tailwind CSS Height class

The h-auto class allows the element’s height to adjust dynamically based on its content.


h-auto

The h-auto class allows the element’s height to adjust dynamically based on its content. Instead of setting a fixed height, the element expands or contracts depending on how much content is inside it. This is useful for paragraphs, cards, or dynamic elements like accordions.

Code Example

html
<div class="h-auto bg-indigo-500 text-white text-center flex justify-center items-center font-bold rounded-md">Height: auto</div>

Preview

Height: auto

Windframe is a drag and drop builder for rapidly building tailwind css websites and UIs

Start building stunning tailwind UIs! 

Build from scratch or select prebuilt tailwind templates