How to make the web page height to fit screen height with HTML?



Many ways are available to make the web page height to fit the screen height −

Give relative heights −

html, body {
   height: 100%;
}

You can also give fixed positioning −

#main
{
   position:fixed;
   top:0px;
   bottom:0px;
   left:0px;
   right:0px;
}

You can also use Viewport height to fulfill your purpose −

height: 100vh;
Updated on: 2020-06-25T06:24:42+05:30

3K+ Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements