The question arose how to achieve such an alignment so that the filling started in the upper right corner, went down, and if there was not enough space, it would shift to the left.

I tried to play using a fixed parent container and scale country forms with negative values ​​for both each item and the parent container, but did not achieve the desired result.

Grouping from the upper right corner to the lower left corner

    1 answer 1

    put the container style:

    display: flex; flex-wrap: wrap-reverse; flex-direction: column; 

    https://codepen.io/anon/pen/OobBBp