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%.