Good afternoon I hope you can help me. I'm doing a simple layout with Flexbox but I can not get the "content" to cover 100% of the available space, the structure is simple:
- Menu
- Content
- Pie
It is important to emphasize that the "Menu" and "Foot" must have a height: auto , this when the screen changes size the items (children) can adapt and be responsive. Since these 2 work as I wish, even the "Content" is expanded as it grows, this is perfect !, but when I try to include 100% of the space between the "Menu" and the "Foot" is where the problems come from.
EYE: in the "content" leave a Lorem of 600 words so that they can perform the test to expand and just as this "Lorem600" can do the test of covering 100% of the available space between the Menu and foot.
I would greatly appreciate the help you can give me (I already have 2 days looking for information and I do not give with the solution). Thanks !!
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<style type="text/css">
* {
padding: 0;
margin: 0;
outline: 0;
}
html,
body {
height: 100vh;
width: 100%;
font-family: Verdana, arial, sans-serif;
}
#contenedor {
height: 100vh;
width: 100%;
display: flex;
flex-direction: row;
flex-wrap: wrap;
justify-content:flex-start;
}
#cabecera {
height: auto;
width: 100%;
background-color: #399;
color: #fff;
text-align: center;
align-self: flex-start;
display: flex;
flex-wrap: wrap;
}
#contenido {
margin: 10px 0px;
height: auto;
width: 100%;
background-color: yellow;
display: flex;
flex-wrap: wrap;
}
#pie {
height: auto;
width: 100%;
background-color: #399;
color: #fff;
text-align: center;
align-self: flex-end;
display: flex;
flex-wrap: wrap;
}
.x {
font-size: 20px;
margin: 10px;
}
</style>
</head>
<body>
<div id="contenedor">
<div id="cabecera">
<div class="x">Cabecera</div>
<div class="x">items</div>
<div class="x">items2</div>
</div>
<div id="contenido">
<p>Lorem600</p>
</div>
<div id="pie">
<div class="x">items3</div>
<div class="x">items4</div>
</div>
</div>
</body>
</html>