I was expecting that setting grid-template-rows
to fr
will make that row to expand to fill all available space but in my case it is not doing it anyway. In other words below code must have resulted in three rows first and third of which are as thin as their content while second row fills the all remaining space in between. Tried it both on my local machine and codesandbox and am getting the same result
html:
<div class="container">
<div class="item">1</div>
<div class="item">2</div>
<div class="item">3</div>
</div>
css:
.container {
display: grid;
grid-template-rows: auto 1fr auto;
}
.item {
border: 1px solid red;
}