Kevin Powell - CommunityKP-C
Kevin Powell - Community14mo ago
76 replies
Dovah

More elegant fit for elements auto stacking than grid-template-columns: repeat(auto-fit, n);

As you can see on the pictures, that empty space is eventually created on certain screen sizes that look super ugly. Any more dynamic and elegant ides where cards will fill up all the space and eventually stack like in the picture, outside of hard codding it for each screen size?

CSS code:
css 
display: grid;
width: 100%;
grid-template-columns: repeat(auto-fit, max(13.313rem));
gap: 1.5rem;
1.PNG
2.PNG
Was this page helpful?