Currently, I have a list of hexagons (images) that I move to the next line when reducing the width of the browser. However, when this happens, they form even lines, as seen in the first image, each of which starts at the same point along the x axis.

Here is a JS script (although hexes do not flow directly because they are not images). The real code for this is:
<div class="container"> <span> <img class="hex" src="img/hex.png"> </span> ... </div>
And CSS:
.container { padding-top: 80px; width: 50%; margin-left: auto; margin-right: auto; } .container span { line-height: 129px; display: inline-block; } .container .hex { display: block; margin-left: auto; margin-right: auto; }
What I would like to do is alternate the lines so that each other line starts with an offset of the size of the hexagon, as shown in Figure 2. It should also be noted that this example also has a negative y-position relative to the corresponding position, determined from the first image. 
Is there a way to do this with CSS only? I would like to avoid using the library, if at all possible.
This seems like a question here , but I need the whole structure to have an indefinite number of rows, so the solution in which I specify the elements in which the rows are not suitable for my application.
Jtate source share