I want to make a div occupy the entire bottom of the screen.
As a solution, I thought of declaring this div (in the example "div2") with height:100%;
.
Not working, I saw that people say that the solution to this is to declare html, body {height=100%;}
.
It still does not work as shown in the snippet below.
Another thing I've tried is declaring height:100vh;
. But this is incorrect, since having the "div1" this causes an overflow and I just want you to fill the screen.
html, body{
height:100%
margin 0;
}
#div1{
height:80px;
width: 100%;
background-color: red;
display:flex;
justify-content: center;
align-items: center;
}
#div2{
height:100%;
width: 100%;
background-color: green;
}
<div id="div1"> Contenido del div 1 </div>
<div id="div2"> Contenido del div 2. Este div quiero que ocupe hasta el final de la pantalla de manera vertical. </div>
Cheers!