Question:I have a grid with 2 columns x 2 rows. All of them are set in
minmax()size. Can I ask why the element with class
showdoesn’t take the full size of the grid even though I set all other elements (
hideclass) in the grid to width 0 and height 0. Doesn’t
minmax()function is working fine. So is the
The problem is a misunderstanding about the minimum height and widths that are set.
Even though you set the grid items to zero width and height:
.showfrom expanding across the entire container.
grid-template-*. That will enable the column / row to track the size of the grid item.
Also consider the solutions in these posts:
- How to make a column span full width when a second column is not there? (CSS Grid)
- Is it possible to hide columns with empty content via the grid-template-columns definition?
- minmax() defaulting to max
If you have better answer, please add a comment about this, thank you!