CSS, Web, Web Development, Layout.
padding: 1em; display: grid; grid-template-columns: repeat(auto-fit, minmax(60px, 1fr)); gap: 1em; grid-auto-flow: dense; } For .grid__item you can control the position of grid items through grid-column and grid-row : Adding grid-auto-flow: dense will automatically flow to the appropriate location