Categories
CSS

How to make a div 100% height of the browser window with CSS?

Spread the love

Sometimes, we want to make a div 100% height of the browser window with CSS

In this article, we’ll look at how to make a div 100% height of the browser window with CSS.

How to make a div 100% height of the browser window with CSS?

To make a div 100% height of the browser window with CSS, we set the height to 100vh.

For instance, we write

div {
  height: 100vh;
}

to make the div fill the screen with height: 100vh;.

Conclusion

To make a div 100% height of the browser window with CSS, we set the height to 100vh.

By John Au-Yeung

Web developer specializing in React, Vue, and front end development.

Leave a Reply

Your email address will not be published. Required fields are marked *