We use cookies to improve your experience. Learn more in our Privacy policy.
height
The height CSS property specifies the height of an element. By default, the property defines the height of the content area. If box-sizing is set to border-box, however, it instead determines the height of the border area.
Example
Initial value | auto |
Applies to | all elements but non-replaced inline elements, table columns, and column groups |
Syntax
height: 180px;
Values
Defines the height as an absolute value.
Defines the height as a percentage of the containing block's height.
The browser will calculate and select a height for the specified element.
The intrinsic preferred height.
The intrinsic minimum height.
Uses the fit-content formula with the available space replaced by the specified argument, i.e. min(max-content, max(min-content, )).
Browser support
height | 1 | 12 | 1 | 4 | 7 | 1 |
fit-content | 46 | 79 | 33 | 11 | ||
max-content | 46 | 79 | 66 | 44 | 11 | |
min-content | 46 | 79 | 66 | 44 | 11 | |
stretch | 28 | 79 | 15 | 9 |