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.

    1. <div class="h-48">
    2. <div class="h-full ...">
    3. <!-- This element will have a height of `12rem` (h-48) -->
    4. </div>
    5. </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.

    1. <!-- ... -->
    2. </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

    1. theme: {
    2. extend: {
    3. '128': '32rem',
    4. }
    5. }
    6. }
    7. }

    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.

    1. <div class="h-[32rem]">