CSS height property is used to set height of an HTML elements like <div>, <p>, etc.
Supposed, I want to write CSS height Syntax for <div> element:
CSS Height Syntax for <div> Element:
div {
height: 300px;
}
We can apply height property of an elements by using (#) ID and (.) Class selectors for example:
.My_div {
height: 400px;
}
<div class="My_div "> This is my first div with Class selector</div>
****************************************************************************
#My_div {
height: 400px;
}
<div id="My_div "> This is my first div with ID selector</div>