Here is 2 ways, using display: table
Side note: The display: table
version work on IE 11, Edge, Chrome, Firefox, Safari. Because of a render issue in IE10 and below, you'll need a fixed height on the footer and header and use calc() to set the height on the inner cell/div to make it scroll.
html, body{
height: 100%;
margin: 0;
}
.tbl{
display:table;
table-layout: fixed;
border-collapse: collapse;
}
.row{
display:table-row;
}
.row.expanded{
height: 100%;
}
.cell{
display:table-cell;
}
.container,
.content{
width: 100%;
height: 100%;
}
.header {
background: #0099cc none repeat scroll 0 0;
height: 75px;
}
.footer {
background: #3a3a3a;
height: 75px;
}
#left_col {
background: orange none repeat scroll 0 0;
width: 50%;
height: 100%;
}
.scrollwrap {
position: relative;
height: 100%;
}
.scroll {
position: absolute;
left: 0;
top: 0;
right: 0;
bottom: 0;
overflow: auto;
}
#right_col {
background: green none repeat scroll 0 0;
width: 50%;
}
<div class="tbl container">
<div class="row">
<div class="cell header">
</div>
</div>
<div class="row expanded">
<div class="cell">
<div class="tbl content">
<div class="row">
<div id="left_col" class="cell">
<div class="scrollwrap">
<div class="scroll">
long content <br>long content <br>long content <br>long content <br>
long content <br>long content <br>long content <br>long content <br>
long content <br>long content <br>long content <br>long content <br>
long content last
</div>
</div>
</div>
<div id="right_col" class="cell"></div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="cell footer">
</div>
</div>
</div>
and the recommended, using flexbox
, though with less browser support on older browsers
html, body{
margin: 0;
}
.flex{
display:flex;
}
.flex.column {
flex-direction: column
}
.flexitem{
}
.container{
height: 100vh;
}
.header {
background: #0099cc none repeat scroll 0 0;
height: 75px;
}
.content{
flex: 1;
}
.footer {
background: #3a3a3a;
height: 75px;
}
#left_col {
background: orange none repeat scroll 0 0;
width: 50%;
overflow: auto;
}
#right_col {
background: green none repeat scroll 0 0;
width: 50%;
}
<div class="flex column container">
<div class="header">
</div>
<div class="flex content">
<div id="left_col">
long content <br>long content <br>long content <br>long content <br>
long content <br>long content <br>long content <br>long content <br>
long content <br>long content <br>long content <br>long content <br>
long content last
</div>
<div id="right_col"></div>
</div>
<div class="footer">
</div>
</div>