Clarify: This does not duplicate the question on Chrome / Safari not filling 100% height of flex parent
My question is related to container not stretching with content. Otherwise the container stretches just fine without content. The problem is when I actually start to pour content into the container to increase its height.
The "main" element should be stretching with content but it's currently not doing so. My code is below:
html, body {
height: 100%;
min-height: 100%;
margin: 0;
padding: 0;
}
header, footer {
height: 40px;
background: #fafafa;
display: block;
}
#page-wrapper {
display: flex;
flex-direction: column;
background: lightpink;
min-height: 100%;
}
main {
display: flex;
background: darkred;
flex: 1;
flex-direction: row;
}
#reader {
flex: 1;
background: orange;
}
#splitcontent {
background: lightblue;
width: 200px;
}
<div id="page-wrapper">
<header>header</header>
<main id="content">
<article id="reader">
<p>test</p>
<p>test</p>
<p>test</p>
<p>test</p>
<p>test</p>
<p>test</p>
<p>test</p>
<p>test</p>
<p>test</p>
<p>test</p>
<p>test</p>
<p>test</p>
<p>test</p>
<p>test</p>
<p>test</p>
<p>test</p>
<p>test</p>
<p>test</p>
<p>test</p>
<p>test</p>
<p>test</p>
<p>test</p>
<p>test</p>
<p>test</p>
<p>test</p>
<p>test</p>
<p>test</p>
<p>test</p>
<p>test</p>
<p>test</p>
<p>test</p>
<p>test</p>
<p>test</p>
<p>test</p>
<p>test</p>
<p>test</p>
<p>test</p>
<p>test</p>
<p>test</p>
<p>test</p>
<p>test</p>
<p>test</p>
<p>test</p>
<p>test</p>
<p>test</p>
<p>test</p>
<p>test</p>
<p>test</p>
<p>test</p>
<p>test</p>
<p>test</p>
<p>test</p>
<p>test</p>
<p>test</p>
<p>test</p>
<p>test</p>
<p>test</p>
<p>test</p>
<p>test</p>
<p>test</p>
<p>test</p>
<p>test</p>
<p>test</p>
<p>test</p>
</article>
<article id="splitcontent">
</article>
</main>
<footer>footer</footer>
</div>