min-h-screen: Tailwind CSS Height class

The min-h-screen class ensures an element is at least 100vh (full screen height).


min-h-screen

The min-h-screen class ensures an element is at least 100vh (full screen height). It forces elements like hero sections or landing pages to take up the full viewport height.

Code Example

html
<div class="min-h-screen bg-indigo-500 text-white text-center flex items-center justify-center px-5 font-medium">
This box takes at least the height of the screen.
</div>

Preview

This box takes at least the height of the screen.

How to Use

Add the min-h-screen class directly to your HTML element:

html
<div class="min-h-screen">
<!-- Your content here -->
</div>

Responsive Usage

Use Tailwind's responsive prefixes to apply min-h-screen at specific breakpoints:

html
<div class="sm:min-h-screen md:min-h-screen lg:min-h-screen">
Responsive element
</div>
  • sm:min-h-screen — applies from 640px and up
  • md:min-h-screen — applies from 768px and up
  • lg:min-h-screen — applies from 1024px and up

Customization

You can extend or override this utility in your tailwind.config.js. See the Tailwind CSS documentation for details on customizing your theme.

Windframe is an AI visual editor for rapidly building stunning web UIs & websites

Start building stunning web UIs & websites!

Build from scratch or select prebuilt tailwind templates