I want to have two containers(green and red in the example) to be sized 100% of available space(in the example all space except header). Second column have large content which overflows vertically. I would like only second column to have scrollbar without body scrollbar. If I remove header everything works as intended but with header I see global scrollbar. Why?
body {
padding: 0;
margin: 0;
height: 100%;
}
html {
height: 100%;
}
.main {
height: 100%;
display: flex;
flex-direction: column;
}
.container {
display: flex;
flex: 1;
height: 100%;
}
.left {
width: 200px;
height: 100%;
background: green;
}
.right {
width: 200px;
height: 100%;
background: red;
overflow: auto;
}
<div class="main">
<div>Header</div>
<div class="container">
<div class="left"></div>
<div class="right">
<div style="height: 4000px;"></div>
</div>
</div>
</div>