<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<style>
html,body{height:100%;margin: 0;padding: 0;}
.flex-container{height: 100%;display: flex;flex-direction: column;text-align: center;
width: 100%;
position: absolute;
top: 0;
left:0;
}
.flex-item:nth-child(1),.flex-item:nth-child(3){flex-grow: 0;flex-shrink: 0;background-color: #ababab;}
.flex-item:nth-child(2){flex-grow: 1;flex-shrink: 1;background-color: #000;overflow-y: auto; color: #fff;}
.center{position: fixed;top: 50%;left: 50%;margin-top: -10px;margin-left: -24px;}
</style>
</head>
<body>
<div class="flex-container">
<div class="flex-item">top</div>
<div class="flex-item">
center<br>
center<br>
center<br>
center<br>
center<br>
center<br>
center<br>
center<br>
center<br>
center<br>
center<br>
center<br>
center<br>
center<br>
center<br>
center<br>
center<br>
center<br>
center<br>
center<br>
center<br>
center<br>
center<br>
center<br>
center<br>
center<br>
center<br>
center<br>
center<br>
center<br>
center<br>
center<br>
center<br>
center<br>
center<br>
center<br>
center<br>
center<br>
center<br>
center<br>
center<br>
center<br>
center<br>
center<br>
center<br>
center<br>
center<br>
center<br>
center<br>
center<br>
center<br>
center<br>
center<br>
center<br>
center<br>
center<br>
center<br>
center<br>
center<br>
center<br>
center<br>
</div>
<div class="flex-item">bottom</div>
</div>
</body>
</html>