Sometimes, we want to make React component full screen (with height 100%) with CSS.
In this article, we’ll look at how to make React component full screen (with height 100%) with CSS.
How to make React component full screen (with height 100%) with CSS?
To make React component full screen (with height 100%) with CSS, we set the height of a few elements to 100%.
For instance, we write
html,
body,
#app,
#app > div {
height: 100%;
}
to make the html, body, element with ID app, and the div inside the element with ID app hav height 100% to make them full screen.
Conclusion
To make React component full screen (with height 100%) with CSS, we set the height of a few elements to 100%.