Previously I used Flexbox to create a 12 column grid system. When implementing a similar system using CSS Grid, there was a problem with column alignment.
For example: there is a system of 12 columns and two elements that occupy 3 columns, which go one after another, when using Flexbox you can specify the justify-content: space-between
to separate these columns on both sides of the container.
How to achieve the same behavior when using CSS Grid provided that the width of the columns is specified in fr
and the number of columns occupied by the element is specified using the grid-column: span $number
property?
It is not desirable to specify manually which column the element starts with in order to achieve an offset in this way (for example: starts with column 9 and ends with column 12).
I have attached a basic reproducible example.