How to change height of Div using CSS?

Answer

To change height of Div using CSS, you can set the height style property for the div elements with the values like 100px, 200px, 300px, etc.

CSS Code

The following is the typical CSS code to change height of Div in HTML page using tag name div.

Using height of 100px

div {
   height: 100px;
}

Using height of 200px

div {
   height: 200px;
}

Using height of 300px

div {
   height: 300px;
}

Examples

We shall go through some working examples on how to change height of Div using CSS. In the following examples, you may change the value of height and Run the code to visually observe the changes made to the Div elements.

Example 1

This is an example on how to change height of Div using height of 100px .

You may edit the following code, and click on Run button.

Example 2

This is an example on how to change height of Div using height of 200px.

You may edit the following code, and click on Run button.

Example 3

This is an example on how to change height of Div using height of 300px.

You may edit the following code, and click on Run button.