Kevin Powell - CommunityKP-C
Kevin Powell - Communityโ€ข4mo agoโ€ข
18 replies
Vick

Grid layout - make last item span to the last column

I was thinking if there was a way to make dynamically the last element in a given grid to span to the last column of at the end there are some empty slots.

I know that using

grid-column: span x:


But this only works when we know x but now we don't know x.

I also thought of using

grid-column-end: -1;


But this one moves the element to the end without spanning it allover.

Is there a way to do this for grid element like with flex-grow:1 for flex elements.
Was this page helpful?