Tailwind CSS
/Intermediate
Min/Max Height
Definition
Utilities for setting the minimum and maximum height of an element.
Explain Like I'm New
Min-height guarantees a foundation. `min-h-screen` says: 'Be AT LEAST as tall as the monitor. If there's 10,000 lines of text, stretch downwards to fit it. But if the page is empty, don't collapse—stay as tall as the monitor so the footer stays at the bottom.'
Real World Example
Building a standard web layout where you want the footer pushed to the absolute bottom of the screen, even if the main page has zero content.
Common Use Cases
- •Sticky footers
- •Scrollable dropdown menus (`max-h-60`)
Interactive Example
Interview Questions
basic
- What is the difference between `h-screen` and `min-h-screen`?
intermediate
- How do you create a scrollable dropdown menu using max-height?