The solution with inline-block
forces you to insert <br>
after each element.
The solution with float
forces you to wrap all elements with "clearfix" div.
Another elegant solution is to use display: table
for elements.
With this solution you don't need to insert line breaks manually (like with inline-block
), you don't need a wrapper around your elements (like with floats) and you can center your element if you need.
http://jsfiddle.net/8md3jy4r/3/