I have a container with a max-height. I'd like to place in it a header and a scrolling body. It's simple in most browsers, but I'm struggling with IE11. Using max-height: inherit;
, the .scroll
div and its scrollbar extends below its parent (see snippet in IE11)
It's trivial using flexbox instead, but IE11 has a bug that requires changing the display of body
to resolve. But I can't do that.
Is there some way to get .scroll
to scroll correctly in IE11 without flexbox, and while respecting the max-height
functionality on the container?
div {
border: 1px solid #DDD;
}
.container {
max-height: 150px;
overflow: hidden;
}
.header {
height: 40px;
}
.scroll {
max-height: inherit;
overflow: auto;
}
<div class="container">
<div class="header">
header
</div>
<div class="scroll">
<div>scroll</div>
<div>scroll</div>
<div>scroll</div>
<div>scroll</div>
<div>scroll</div>
<div>scroll</div>
<div>scroll</div>
<div>scroll</div>
<div>scroll</div>
<div>scroll</div>
<div>scroll</div>
</div>
</div>