I have a grid
(.genTempGrid
) inside a column flexbox
(which, in turn, is also inside column flexbox
). Strangely, the created grid
is not occupying full height of its div, instead, its height is limited to its content.
My understanding is, no matter what, height of grid
== height of the div on which its sitting. Pls correct me if I am wrong.
.d-flex-column-last-child-flex-grow-1 {
flex-grow: 1;
display: flex;
flex-direction: column;
/*height: 100%;*/
}
.child-expand {
flex-grow: 1;
}
.genTempGrid {
display: grid;
height: 100%;
grid-template-columns: 20% 60% 20%;
grid-template-rows: 1fr;
background-color: #f7f7f7;
}
.border1 {
border: 1px solid red;
}
<div class="d-flex-column-last-child-flex-grow-1" style="height: 50vh">
<div class=" d-flex-column-last-child-flex-grow-1 child-expand">
<div class="pl-3 genTempGrid pt-2 child-expand border1">
<div class="border1">hi</div>
<div>hi</div>
<div>hi</div>
</div>
</div>
</div>
Edit: I am not looking for workarounds. I am more interested to know the reason behind the current behavior.