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 of the div to 100vh.

For instance, we write

div {
  height: 100vh;
}

to set the height CSS property to 100vh to make the div fill 100% of the height of the browser window.

Conclusion

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

Leave a Reply

Your email address will not be published.