How to make .col
element 100% of .container
?
.wrapper {
max-height: 300px;
display: flex;
}
.container {
flex-grow: 1;
display: flex;
overflow-y: auto;
overflow-x: hidden;
gap: 10px;
}
.col {
display: flex;
flex-direction: column;
flex: 1;
gap: 10px;
background-color: blue;
}
.child {
height: 100px;
min-height: 100px;
background: rgba(189, 66, 66, 0.226);
}
<div class="wrapper">
<div class="container">
<div class="col">
<div class="child"></div>
<div class="child"></div>
<div class="child"></div>
<div class="child"></div>
</div>
<div class="col">
<div class="child"></div>
<div class="child"></div>
<div class="child"></div>
<div class="child"></div>
</div>
</div>
</div>
3
Answers
Thank you Pete, simple wrapping
.container
with div without flx is working.If you want it to go full width and put the Elements under each user simply give the Container "flex-direction: column;"
You can use:
On your
.container
element. I am not expert especially with these max-height and overflow, but it seems to make the deal.