I'm trying to implement a kind of dashboard with no scrolling page. I have a grid layout with some sections at 100vh height. The problem is that inside those sections, I want a child div to overflow when they are bigger than 100% of the parent container, but they are expanding its content instead of overflowing.
Here is the HTML:
<div class="page-holder w-100 p-5">
<div class="grid-container">
<section class="item1">
<div class="card">
<div class="card-header">Section</div>
<div class="card-body">
<p>Here some content fixed</p>
<p>Below the overflow content with max-height 100%</p>
<div class="content-overflow">
<div class="row">
<div class="col-md-12">
<p>Row</p>
</div>
</div>
....
</div>
</div>
</div>
</section>
<section class="item2">
<div class="card">
<div class="card-header">Section</div>
<div class="card-body">
<div class="content-overflow">
<div class="row">
<div class="col-md-12">
<p>Row</p>
</div>
</div>
<div class="row">
<div class="col-md-12">
<p>Row</p>
</div>
</div>
...
</div>
</div>
</div>
</section>
<section class="item3">
<div class="card">
<div class="card-header">Section</div>
<div class="card-body">
<div class="content-overflow">Empty Content</div>
</div>
</div>
</section>
</div>
And here is the CSS:
.page-holder {
height: calc(100vh - 40px);
...
}
.grid-container {
display: grid;
...
height: 100%;
}
section, section > .card {
height: 100%;
}
.content-overflow {
overflow-y: auto;
heigth: 100%; /* Not working - it only overflows if I set height on px */
background: blue;
color: white;
}
You can see the full code in the following CodePen.
