I need help, I have problems with a CSS code. I have the following document both html and body I have set them to occupy all the height and width of the screen. inside body I have a container box, that in turn has two boxes plus header and content, the header does not have a predefined height, but I want the content box to take the remaining parent container, but I put a high height and it takes the height of the body and not the remainder of the container, then attach the code beforehand thanks.
* {
padding: 0;
margin: 0;
}
html,
body {
width: 100%;
height: 100%;
background: blue;
}
.contenido {
width: 100%;
height: 100%;
}
.cabecera {
background: red;
width: 100%;
}
.main {
width: 100%;
height: 100%;
background: #000;
color: #fff;
}
<div class="contenido">
<div class="cabecera">
<h1>Esto es la cabecera</h1>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Odio explicabo quae sed nisi cupiditate mollitia praesentium, quisquam consequuntur expedita inventore eligendi placeat, ratione, ipsa reprehenderit voluptates deserunt, dicta facilis soluta.</p>
</div>
<div class="main">
<p>contenido principal</p>
</div>
</div>