JSFiddle - React, Tailwind, and code Playground
by mankhanr
HTML
<div class="all-wrapper">
<div class="wrapper-1">
<div>some stuff</div>
<div>some other stuff</div>
</div>
<div class="wrapper-2">
<div>more and more and more and more and more and more and more and more and more and more and more more and more more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and more stuff</div>
</div>
<div class="wrapper-3">
<div id="header">
<div>My</div>
<div>Header than can grow</div>
</div>
<div id="content">
<div>My Content that will fill remaining space untill page has to scroll</div>
<div>My Content that will fill remaining space untill page has to scroll</div>
<div>My Content that will fill remaining space untill page has to scroll</div>
<div>My Content that will fill remaining space untill page has to scroll</div>
<div>My Content that will fill remaining space untill page has to scroll</div>
<div>My Content that will fill remaining space untill page has to scroll</div>
<div>My Content that will fill remaining space untill page has to scroll</div>
<div>My Content that will fill remaining space untill page has to scroll</div>
<div>My Content that will fill remaining space untill page has to scroll</div>
<div>My Content that will fill remaining space untill page has to scroll</div>
<div>My Content that will fill remaining space untill page has to scroll</div>
</div>
</div>
</div>
CSS
html, body {
margin: 0;
height: 100%;
}
.all-wrapper{
height: 100%;
display:flex;
flex-direction:column;
}
.wrapper-1 {
background: white;
}
.wrapper-2 {
background: lime;
}
.wrapper-3 {
flex: 1;
display: flex;
flex-direction: column;
overflow:hidden;
}
#header {
background: #edc;
}
#content {
flex: 1;
background: yellow;
overflow: auto;
}
#content div {
min-height: 50px;
}