CSS height Property


The height property is used to specify an element's height. Padding, margin, and element border are not included in the height property.

Syntax

Example

Preview

Property Values

Value Description
auto The height is calculated by the browser. This is the default setting.
length Defines the height in pixels, centimeters, and so on. Learn more about length units.
% Defines the height of the containing block as a percentage.
initial This property is set to its default value.
inherit This property is inherited from its parent element.

Supported Browsers

Property Chrome Firefox Safari Edge / IE Opera
height 1.0 1.0 1.0 4.0 7.0