Looking at the code in question, it appears that the issue is that the cols do not have a consistent height. It is wrapping underneath the 6th element to the right of the 5th which is taller than the 6th. If you set the squares to a specific height, then it will work as a proper grid and still allow you to make it responsive so that your rows can have different widths for different resolutions. If you use clearfixes, then your rows are always going to have to end on the same counts.
It seems there might be some confusion on the need for class='row' based on some of the answers. In Bootstrap 2 you did NEED to have NEW rows for each row because of the :first-child having different margins than the rest of the spans. However, Boostrap 3 uses the:
box-sizing:border-box
Which allows it to set the padding for every single col-* the same. Thus, as you can see from the following HTML, there are no column wrapping issues:
<!doctype html>
<html>
<head>
<link rel='stylesheet' type='text/css' href='//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css' />
</head>
<body>
<div class='container'>
<div class='row'>
<div class='col-xs-2'><div style='background-color:navy;height:30px;margin-top:6px;'> </div></div>
<div class='col-xs-2'><div style='background-color:navy;height:30px;margin-top:6px;'> </div></div>
<div class='col-xs-2'><div style='background-color:navy;height:30px;margin-top:6px;'> </div></div>
<div class='col-xs-2'><div style='background-color:navy;height:30px;margin-top:6px;'> </div></div>
<div class='col-xs-2'><div style='background-color:navy;height:30px;margin-top:6px;'> </div></div>
<div class='col-xs-2'><div style='background-color:navy;height:30px;margin-top:6px;'> </div></div>
<div class='col-xs-2'><div style='background-color:navy;height:30px;margin-top:6px;'> </div></div>
<div class='col-xs-2'><div style='background-color:navy;height:30px;margin-top:6px;'> </div></div>
<div class='col-xs-2'><div style='background-color:navy;height:30px;margin-top:6px;'> </div></div>
<div class='col-xs-2'><div style='background-color:navy;height:30px;margin-top:6px;'> </div></div>
<div class='col-xs-2'><div style='background-color:navy;height:30px;margin-top:6px;'> </div></div>
<div class='col-xs-2'><div style='background-color:navy;height:30px;margin-top:6px;'> </div></div>
<div class='col-xs-2'><div style='background-color:navy;height:30px;margin-top:6px;'> </div></div>
<div class='col-xs-2'><div style='background-color:navy;height:30px;margin-top:6px;'> </div></div>
<div class='col-xs-2'><div style='background-color:navy;height:30px;margin-top:6px;'> </div></div>
<div class='col-xs-2'><div style='background-color:navy;height:30px;margin-top:6px;'> </div></div>
<div class='col-xs-2'><div style='background-color:navy;height:30px;margin-top:6px;'> </div></div>
</div>
</div>
</body>
</html>
So, you do NOT need a row to wrap every group of 6 col-*. If you did, then the responsive features wouldn't work. E.g. you might use col-md-2 col-sm-3 col-xs-6
and the col-xs-6 would require a new row after every 2 entries, the col-sm every 4 entries, and the col-md every 6 entries. Clearly we can't change the HTML for ever screen size...so, when you want dynamic data to wrap in a grid, you do NOT want to use a row for each grouping. Make sense?
However, you DO need a single ROW that has the negative margin-left:-20px;
and margin-right:-20px;
to offset the container's 20px padding...otherwise you will have wrapping issues where your col-* widths end up 40px bigger than the amount.
Anyway, just wanted to make this clarification for people who happen to wind up on this page and start thinking they have to wrap every group with rows like the old BS2.