The min-height property sets the minimum vertical height of an element. It is especially useful when you want to ensure a box never collapses too short while still letting taller content grow naturally.
01
Height Floor
Set a lower limit.
02
auto Default
Content minimum by default.
03
Pixels / vh
Fixed and viewport floors.
04
Percentages
Relative to parent.
05
Content Growth
Grows above minimum.
06
Related
height, max-height.
Fundamentals
Introduction
The min-height property in CSS defines the minimum height of an element. This property is useful for ensuring elements do not collapse too short in a block formatting context while keeping layouts predictable on different screen sizes.
By specifying a minimum height, you can keep cards, panels, and sections visually balanced even when content is short, which helps maintain layout consistency across different devices and screen sizes.
Definition and Usage
min-height always sets a vertical floor in normal horizontal layouts. The element can grow taller when content needs more space, but it will not shrink below the minimum you set.
Use min-height alongside height and max-height for full vertical sizing control.
💡
Beginner Tip
Think of min-height as a floor: the box can grow taller when content needs more space, but it will not shrink below the minimum you set.
Foundation
📝 Syntax
Write min-height with a length, percentage, or auto:
The initial value is auto, meaning no explicit minimum height constraint.
Length values such as px, rem, and vh set a fixed lower limit.
Percentages are relative to the containing block’s height.
Pair with height and max-height when you need preferred and maximum sizes too.
Cheat Sheet
⚡ Quick Reference
Question
Answer
Initial value
auto
Applies to
All elements
Inherited
No
Animatable
No
Common use
Cards, panels, and sections that must not collapse below a minimum height
Defaults
🎯 Default Value
The default value of min-height is auto. Without explicit styling, the element has no explicit minimum height constraint and can shrink to fit its content based on other sizing properties.
Reference
💎 Property Values
These are the most common values you will use with min-height.
Value
Example
Meaning
auto
min-height: auto;
No explicit minimum; content determines height (default)
Length
min-height: 200px;
Defines a fixed minimum height using units such as px, rem, or vh
Percentage
min-height: 50%;
Minimum height relative to the containing block height
200px
Fixed pixel floor for panels and cards.
200px min
Ensures boxes never collapse too small.
50%
Scales with the parent element height.
Min 50%
Parent needs a defined height.
auto
No explicit floor — content sets the minimum.
Content min
Default browser behavior.
Scope
Height, min-height, and max-height
Use physical height properties together when you want predictable vertical sizing in standard horizontal layouts.
height sets the preferred or fixed height of the box.
min-height sets the lower limit so content never shrinks below a minimum.
max-height sets the upper limit on the same vertical axis.
For writing-mode-aware layouts, see min-block-size on the logical block axis.
Compare
min-height vs min-block-size
Property
Axis
Best for
min-block-size
Block axis (depends on writing mode)
International layouts, reusable components, logical sizing systems
min-height
Always vertical
Simple pages with fixed minimum heights in horizontal writing
height
Always vertical
Preferred height paired with max/min limits
max-height
Always vertical
Upper limit on vertical size in horizontal writing
Preview
👀 Live Preview
Three boxes with different min-height floors and the same short text:
auto — minimum follows content.
4rem min — Short text in a taller box.
6rem min — Same short text with a roomier floor.
These values set a floor on vertical height. Taller content grows naturally above the minimum.
Hands-On
Examples Gallery
Try min-height with fixed floors, empty boxes, percentage minimums, and side-by-side comparisons.
📚 Minimum Height Floors
Ensure elements never collapse below a useful height, even when content is short.
Example 1 — 200px Minimum Height
Set a 200px floor so a box is always at least this tall, regardless of how little content it contains.
min-height-200.html
<style>.box{min-height:200px;background-color:lightblue;border:1px solid blue;}</style><divclass="box">
This box has a minimum height of 200 pixels.
</div>
With auto, the box follows content height. Minimum values keep short content in taller boxes.
🧠 How min-height Works
1
You declare a minimum height
Choose a length, percentage, or leave the default auto so content determines the minimum.
CSS rule
2
Content determines natural height
The element sizes itself based on content, padding, and other height properties.
Box model
3
The browser enforces the floor
The box can grow taller when content needs more space, but it cannot shrink below min-height.
Constraint
=
Predictable minimum height
The element never falls below your minimum, keeping layouts tidy even when content is short.
Result
Compatibility
🖥 Browser Compatibility
The min-height property is widely supported across all modern browsers, including Chrome, Firefox, Safari, Edge, and Opera. It is a well-established property you can use confidently to maintain consistent layouts.
✓ Baseline · Universal support
Fundamental layout property
min-height has long been part of CSS layout and works consistently across browsers, much like height and max-height.
99%Browser support
Google ChromeAll versions · Desktop & Mobile
Full support
Mozilla FirefoxAll versions · Desktop & Mobile
Full support
Apple SafariAll versions · macOS & iOS
Full support
Microsoft EdgeAll versions · Chromium & Legacy
Full support
OperaAll modern versions
Full support
min-height property99% supported
Bottom line: You can rely on min-height in production layouts across all major browsers.
Wrap Up
Conclusion
The min-height property is an essential tool for controlling the minimum size of elements on your web page. By ensuring elements have a minimum height, you can create more consistent and predictable layouts, especially in responsive designs.
Experiment with different values to see how they affect the layout and ensure your design remains robust across various screen sizes and content amounts.
Use min-height on cards and panels that should not collapse when content is short
Use it alongside height and max-height for full vertical sizing control
Use viewport units like 50vh for responsive minimum heights
Test layouts on touch devices when panels must stay tall enough for tap targets
Prefer min-height for simple vertical floors with broad browser support
❌ Don’t
Set a minimum without considering how taller content should grow
Confuse min-height with height — one sets a floor, the other sets preferred size
Expect min-height: 50% to work when the parent height is undefined
Assume min-height always equals min-block-size in every layout
Skip min-block-size when layouts may change writing mode and need logical sizing
Summary
Key Takeaways
Knowledge Unlocked
Five things to remember about min-height
Use these points when setting vertical minimums in layouts.
5
Core concepts
📏01
Minimum Floor
Sets the floor.
Purpose
📝02
auto Default
No explicit minimum limit.
Default
🔄03
Physical Axis
Always vertical.
Context
📈04
Content Growth
Grows above minimum.
UX
🛠05
Height Trio
height, min, max.
System
❓ Frequently Asked Questions
The min-height property sets the minimum vertical height of an element. The box can grow taller when content needs more space, but it cannot shrink below the minimum you set.
The default value is auto, which means the element is only as tall as its content requires, with no explicit minimum height constraint.
height sets a preferred or fixed size. min-height sets a lower limit only — the element can grow above it when content is taller.
Common values include auto, length units like px, em, rem, and vh, and percentages relative to the containing block height.
Yes. Percentages are relative to the containing block's height, so the parent usually needs an explicit height or min-height for the percentage to resolve predictably.