Take a look at the code sample below in each Chrome and IE11. In Chrome, the <main> background stops at the edge of the .container element, which is desired. In IE it spills outside of the .container element:
What I'm looking for:
I want IE to have the
<main>element end at the edge of the .container elementin the case of .container2, it's displaying properly: the
<main>element should only take up as much height as it needs.
.container {
height:400px;
background:#333;
display:flex;
flex-direction:column;
width:40%;
position:absolute;
}
.container2 {
left:50%;
}
header {
color:white;
}
main {
background:#ccc;
width:30%;
display:flex;
flex-direction:column;
}
<div class="container">
<header>This is good in Chrome but bad in IE</header>
<main>
<p>content</p>
<p>content</p>
<p>content</p>
<p>content</p>
<p>content</p>
<p>content</p><p>content</p>
<p>content</p>
<p>content</p>
<p>content</p>
<p>content</p>
<p>content</p><p>content</p>
<p>content</p>
<p>content</p>
<p>content</p>
<p>content</p>
<p>content</p><p>content</p>
<p>content</p>
<p>content</p>
<p>content</p>
<p>content</p>
<p>content</p><p>content</p>
<p>content</p>
<p>content</p>
<p>content</p>
<p>content</p>
<p>content</p><p>content</p>
<p>content</p>
<p>content</p>
<p>content</p>
<p>content</p>
<p>content</p><p>content</p>
<p>content</p>
<p>content</p>
<p>content</p>
<p>content</p>
<p>content</p><p>content</p>
<p>content</p>
<p>content</p>
<p>content</p>
<p>content</p>
<p>content</p>
</main>
</div>
<div class="container container2">
<header>This is good in both browsers</header>
<main>
<p>content</p>
<p>content</p>
<p>content</p>
<p>content</p>
<p>content</p>
</main>
</div>