In this example, I am creating a grid that contains as many 200 pixel column tracks as will fit into the container with the remaining space shared equally between the columns. In the minmax() function the first value is the minimum size I want my tracks to be, the second is the maximum. By using 1fr as the maximum value, the space is equally distributed.

I am then spanning columns and rows. As the items are auto-placed on our flexible grid they will move around the grid but maintain their spanned size.

Credit to gridbyexample.com for inspiring this example.

[fl_row] {
    display: grid;
    grid-gap: 10px;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}
[fl_row] .a {
    grid-column: auto / span 2;
}
[fl_row] .k {
    grid-column: auto / span 3;
}
[fl_row] .g {
    grid-column: auto / span 2;
    grid-row: auto / span 2;
}

A

B

C

D

E

F

G

H

I

J

K

L

M