You can use floats. If you need your layout to be responsive, give %
width instead of px
.
You will need to calculate so that the sum of width of every block on each row doesn't exeed 100%.
Then use box-sizing:border-box;
css property so that the width set on each block also contains the border (see here for an overview of that property).
Here is an example FIDDLE