I am trying to configure a div element so that it has 3 rows where the first and last rows' heights fit the height of content. And the middle div fills in the remaining.
I am basing my approach on one of the examples here: https://css-tricks.com/snippets/css/a-guide-to-flexbox but I am not understanding the flex-grow/shrink/basis properties (if that is even the correct approach).
And here is where I stand with the code now: https://jsfiddle.net/CumminsJP/z0gvsyh5/
<div class="wrapper">
<div class="header">
<span class="smiley"></span>
<span>header</span>
<span class="kissymckissface"></span> </div>
<div class="main">
<div>
<p>
content
</p>
</div>
</div>
<div class="footer">
<span class="alien"></span>
<span>footer</span>
<span class="monkey"></span>
</div>
</div>
.wrapper {
display: flex;
flex-flow: row wrap;
font-weight: bold;
text-align: center;
height: 300px;
width: 300px;
}
.wrapper>* {
padding: 10px;
flex-grow: 1;
flex-basis: 100%
}
.header {
background: tomato;
}
.footer {
background: lightgreen;
}
.main {
text-align: center;
background: deepskyblue;
}
body {
padding: 2em;
}
.smiley {
float: left;
}
.kissymckissface {
float: right;
}
.alien {
float: left;
}
.monkey {
float: right;
}
I suspect I'm only a few css properties from a solve, but could use an assist.