I got a grid, made out of inline-block elements so they can overflow to other rows.
The problem is that, if the row is not complete, the items in that row are also centered and not aligned to the left side, like if they'd just overflow.
The problem can be seen in this Fiddle.
Is there any way to do this in the pure CSS ? So that the container is centered, but the elements inside it remain to be on the left side ?
I already tried to use margin: 0 auto;
to center just the container, but the container would have to have fixed width, but in this situation the container expands as far as it can (fills the outer container).
Edit: The only way I can think of is getting the width of the container with Javascript and then dividing the width by the width of the elements (as they have the same width), apply the width to the container and go with the margin: 0 auto; method.