height

Sets the height of an element. It defines the vertical space an element occupies.

Quick example

.hero-section {
  height: 100vh;
  /* fills the entire viewport height */
}

Quick facts

Initial value
auto
Inherited
No
Applies to
all elements but non-replaced and table columns
Animation type
lpc

Values

autolength-percentagemin-contentmax-contentfit-contentcalc-sizeanchor-size

height Browser Support

Widely available Since 2015 96% global usage

This feature is well established and works across many devices and browser versions. It has been available across browsers since 2015.

Safe to use without fallbacks.

1+
1+
1+
12+
ESC