I have the following basic HTML/CSS for a flexbox layout I'm trying to use for a web page:
body, div, html, h1, h2, li, p, ul {
margin: 0;
padding: 0;
}
html,
body {
height: 100%;
}
.container {
display: flex;
flex-direction: column;
min-height: 100%;
}
.headerContainer {
background: darkblue;
color: white;
padding: 10px;
}
.sidebarAndContentContainer {
display: flex;
flex: 1;
}
.sidebar {
background: gray;
padding: 10px;
}
.nav {
color: white;
list-style: none;
}
.content {
padding: 10px;
}
<div class="container">
<div class="headerContainer">
<h1>Site Title</h1>
</div>
<div class="sidebarAndContentContainer">
<div class="sidebar">
<ul class="nav">
<li>Nav Link #1</li>
<li>Nav Link #2</li>
<li>Nav Link #3</li>
<li>Nav Link #4</li>
<li>Nav Link #5</li>
</ul>
</div>
<div class="content">
<h2>Page Title</h2>
<p>Content</p>
<p>Content</p>
<p>Content</p>
<p>Content</p>
</div>
</div>
</div>
The layout looks like what I want in Chrome, Firefox and Edge, but when I load it into IE11, the sidebar div is not stretching the vertical length of the page like it should. In fact, it's only 20px tall (which is just the padding).
Why is this happening in IE11 (which I thought supported flexbox), and more inportantly, how can I fix it? Thanks.
Edit: After figuring out a working solution and posting it, I don't think that this question is a duplicate of the ones linked at the top of the question because ultimately, those other posts did not have the same problem or answer the question I was asking.