I am making a calendar using CSS grid and I was curious if it is possible to center the grid items that are pushed to the next row, if that row is not explicitly defined.
Here is an example of code:
#calendar {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(100px, 150px));
/* grid-template-rows: repeat(auto-fit, 1fr); */
justify-content: center;
min-height: 10vh;
max-height: 100vh;
width: 100%;
padding: 1rem;
}
#calendar>div {
height: 100px;
width: 100%;
border: 2px solid black;
}
<div id="calendar">
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
</div>