Categories
CSS

How to make body have 100% of the browser height with CSS?

Spread the love

Sometimes, we want to make body have 100% of the browser height with CSS.

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

How to make body have 100% of the browser height with CSS?

To make body have 100% of the browser height with CSS, we set its height to 100%.

For instance, we write

html,
body {
  height: 100%;
}

to set the html and body element’s heights to 100% to make them fill the browser’s height.

Conclusion

To make body have 100% of the browser height with CSS, we set its height to 100%.

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 *