height
The height property sets the content-box height of an element.
Syntax
height: <length|%|auto|min-content|max-content>;
Examples
.hero { height: 100dvh; }
.row { height: auto; }
Output
Stretches the hero to the dynamic viewport height and lets the row size to its content.
Notes
Percentage heights need a definite parent height. Use dvh/svh/lvh for mobile-safe viewport heights. auto sizes to content. Avoid fixed heights on text containers to prevent overflow.
Browser & runtime support
| Environment | Since version |
|---|---|
| chrome | 1.0 |
| firefox | 1.0 |
| safari | 1.0 |
| edge | 12 |