The number of blocks each time is different, from 1 to 40. You need to arrange them like this:
1 7 2 8 3 9 4 ... 5 6
The number of columns can be from 1 to 5. The difficulty is that without using scripts, standard html + css to achieve this. Blocks of different heights, and when the next block does not fit below (container height 380px), we start a new column.
In html, I have it all like this:
<div class="test"> <a href="" class="c">Первый</a> <a href="" class="c">Второй</a> <a href="" class="c">Третий</a> <a href="" class="c">Четвертый</a> <a href="" class="c">Пятый</a> <a href="" class="c">Шестой</a> <a href="" class="c">Седьмой</a> .... </div>