Here is my code:
Is even easier:
.inner:nth-child(4n+1) { clear: left; } .inner { float: left; margin: 5px; }
1 2 3 4 5 6 7 8 9 10 11 12
You can apply float: left and clear float: left every 4n+1 elements.
float: left
Ref:
:nth-child