I want to have a panel (a div) center inside a container (a div with flex display).
When the panel is small in height (just change "height: 300px" in my example CSS), it works OK. When the panel is higher ("height: 3000px") than its container, I want to be able to scroll page the whole page (Note I have "overflow-y: auto" on the body).
The issue is the container does not wrap completely the inner div. If you scroll down you can see the red stops and green overflows:
html, body {
height: 100%;
margin: 0;
}
body {
overflow-y: auto;
}
.h100 {
height: 100%;
}
.flex-col {
display: flex;
flex-direction: column;
}
.flex-item-stretch {
flex: 1 1;
}
.panel {
height: 3000px;
width: 300px;
background-color: green;
}
.justify-content-center {
justify-content: center;
}
.vscroll {
overflow-y: auto;
}
.m-auto {
margin: auto;
}
.container {
background-color: red;
padding:10px;
}
<div class="flex-col h100">
<div>
<span>LOGO</span>
</div>
<div class="container flex-col flex-item-stretch m-auto">
<div>Title</div>
<div class="panel flex-item-stretch m-auto"></div>
</div>
</div>