Check out the code on jsFiddle
.component-container {
width: 800px;
height: 200px;
background-color: lightyellow;
border: 1px solid red;
padding: 10px;
overflow: hidden;
}
.component-container .grid-container-1 {
display: grid;
grid-template-columns: 150px 1fr 1fr;
grid-template-rows: 50px 1fr 50px;
grid-gap: 3px;
padding: 3px;
height: 100%;
width: 100%;
background-color: #2196F3;
}
.component-container .grid-container-1 .grid-item {
background-color: rgba(255, 255, 255, 0.8);
border: 1px solid darkblue;
overflow: auto;
}
/* More CSS styling rules here */
button {
margin: 2px;
width: 500px;
}
<div class="component-container">
<div class="grid-container-1">
<div class="grid-item grid-header">
Content goes here
</div>
<div class="grid-item grid-nav">
Navigation links
</div>
<div class="grid-item grid-content-left">
Left content
</div>
<div class="grid-item grid-content-right">
Right content
</div>
<div class="grid-item grid-footer">
Footer content
</div>
</div>
<div class="grid-container-2">
Additional content
</div>
</div>
I have applied some SCSS to style my page using grids. Please note the vertical scroll bars.
Now, I wish to add another div on the right side of this table. When I do that and apply display:grid to the container, the scroll bars disappear because of a height issue.
Please uncomment lines 9-11 in the SCSS provided below.
display: grid;
grid-template-columns: 1fr 1fr;
grid-gap: 10px;
What could be causing this issue?