Your columns are most likely of varying heights which is a common issue with grids like Bootstrap with regard to floats & clear. Bootstrap does have a utility to work with but it's not always a great choice. See Resets.
An alternative.
Since you have 2 different breakpoints that your columns are set at, col-lg-4
and col-sm-6
(col-md-6 isn't needed since it's equal to your small class of col-sm-6), you have to clear the columns at the appropriate breakpoints.
Make sure to be specific when implementing this so it does not affect any other part of the grid you may be using elsewhere. Add a generic class to each column or use something like the example below, etc.
One way to do this is to place the needed rules inside of media queries in conjunction with Pseudo Classes for the columns. Also see MDN nth-child.
Working Example:
@media (min-width: 1200px) {
.grid .col-lg-4:nth-child(3n+1) {
clear: left;
}
}
@media (min-width: 768px) and (max-width: 1199px) {
.grid .col-sm-6:nth-child(2n+1) {
clear: left;
}
}
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet"/>
<div class="container">
<div class="row grid">
<div class="col-lg-4 col-sm-6">
<a class="thumbnail" href="#">
<img src="http://placehold.it/350x350" alt="" />
</a>
<h5>ONE</h5>
<p>Lorem Ipsum has been the industry's standard dummy text ever since the 1500s</p>
</div>
<div class="col-lg-4 col-sm-6">
<a class="thumbnail" href="#">
<img src="http://placehold.it/550x550" alt="" />
</a>
<h5>TWO</h5>
<p>Lorem Ipsum has been the industry's standard dummy text ever since the 1500s. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s</p>
</div>
<div class="col-lg-4 col-sm-6">
<a class="thumbnail" href="#">
<img src="http://placehold.it/350x450" alt="" />
</a>
<h5>THREE</h5>
<p>Lorem Ipsum has been the industry's standard dummy text ever since the 1500s. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s.</p>
</div>
<div class="col-lg-4 col-sm-6">
<a class="thumbnail" href="#">
<img src="http://placehold.it/250x500" alt="" />
</a>
<h5>FOUR</h5>
<p>Lorem Ipsum has been the industry's standard dummy text ever since the 1500s</p>
</div>
<div class="col-lg-4 col-sm-6">
<a class="thumbnail" href="#">
<img src="http://placehold.it/350x150" alt="" />
</a>
<h5>FIVE</h5>
<p>Lorem Ipsum has been the industry's standard dummy text ever since the 1500s. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s.</p>
</div>
</div>
</div>
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…