I'm having trouble getting the content to scroll correctly while dealing with nested flex-box
structures. Below is my CSS code:
html,body,#root{
width:100%;
height:100%;
padding:0;
margin:0;
}
.flex-fill{
height:100%;
width:100%;
display:flex;
align-items:stretch;
}
.flex-fill>div:last-child{
flex-grow:1;
}
.flex-col{
flex-direction:column;
}
<div id='root'>
<div class='flex-fill flex-col'><!--actually scrolling div-->
<div style="flex:0 0 35px"><h1>main title</h1></div>
<div>
<div class='flex-fill flex-col'>
<div style="flex:0 0 30px"><h2>subtitle</h2></div>
<div class='flex-fill'>
<div style="flex:0 0 30%">...left side nav list...</div>
<div class='flex-fill flex-col'>
<div style="flex:0 0 25px">...data header...</div>
<!--I hope the content of this div is scroll-able-->
<div style="overflow-y:scroll">...data list...</div>
</div>
</div>
</div>
</div>
</div>
</div>
The data list within the innermost div is very lengthy and I want it to be scrollable. However, the current code makes the entire content within the root div scroll. Is my understanding of flex or overflow incorrect? How can I modify the code to only enable scrolling for the data list section?