Languages
[Edit]
EN

CSS - set 100% body height (match to window height)

4 points
Created by:
Jan-Alfaro
681

In this article, we would like to show how to stretch body element to 100% height using CSS.

Note: it is required to set height: 100% for html and body elements to stretch body to window height.

Quick solution:

 

Practical example

Edit

The solution presented in this section shows nested div in body element that is stretched to body that has 100% width and height.

Screenshot:

Body with 100% width and height - CSS.
Body with 100% width and height - CSS.
1
Donate to Dirask
Our content is created by volunteers - like Wikipedia. If you think, the things we do are good, donate us. Thanks!
Join to our subscribers to be up to date with content, news and offers.
Native Advertising
🚀
Get your tech brand or product in front of software developers.
For more information Contact us
Dirask - we help you to
solve coding problems.
Ask question.

❤️💻 🙂

Join