Chrome table-row height bug
HTML
<div class="container">
<div class="my-component">
<div class="my-component-top">
<div class="my-component-top-cell">
<div class="my-component-top-inner">
Variable content that should fill the container and scroll.<br>
Variable content that should fill the container and scroll.<br>
Variable content that should fill the container and scroll.<br>
Variable content that should fill the container and scroll.<br>
Variable content that should fill the container and scroll.<br>
Variable content that should fill the container and scroll.<br>
Variable content that should fill the container and scroll.<br>
Variable content that should fill the container and scroll.<br>
Variable content that should fill the container and scroll.<br>
Variable content that should fill the container and scroll.<br>
Variable content that should fill the container and scroll.<br>
Variable content that should fill the container and scroll.<br>
Variable content that should fill the container and scroll.<br>
Variable content that should fill the container and scroll.<br>
Variable content that should fill the container and scroll.<br>
Variable content that should fill the container and scroll.<br>
</div>
</div>
</div>
<div class="my-component-bottom">
Variable content that should extend in height as much as needed.<br>
Variable content that should extend in height as much as needed.<br>
Variable content that should extend in height as much as needed.<br>
Variable content that should extend in height as much as needed.<br>
Variable content that should extend in height as much as needed.<br>
Variable content that should extend in height as much as needed.<br>
Variable content that should extend in height as much as needed.<br>
Variable content that should...
CSS
html, body {
margin: 0;
height: 100%;
}
.container {
height: 100%;
}
.my-component {
display: table;
height: 100%;
width: 100%;
}
.my-component-top {
display: table-row;
background-color: yellow;
height: 100%;
}
.my-component-top-cell {
display: block;
height: 100%;
position: relative;
}
/* IE11 fix - need block */
_:-ms-fullscreen, :root .my-component-top-cell { display: block; }
.my-component-top-inner {
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 100%;
overflow: auto;
}
.my-component-bottom {
display: table-row;
background-color: green;
}