The height property
The height
property sets an element height. The
property value is any
size units
or the key property auto
, which allows the
browser to independently calculate the element size
(default behavior).
Syntax
selector {
height: value;
}
Example
Let's set the block
height to 100px
:
<div id="elem"></div>
#elem {
border: 1px solid black;
width: 300px;
height: 100px;
}
:
Example
Let's set the block height
to 200px
:
<div id="elem"></div>
#elem {
border: 1px solid black;
width: 300px;
height: 200px;
}
: