Bootstrap缩略图没有正常排队

时间:2016-08-10 20:12:42

标签: ruby-on-rails twitter-bootstrap

我在rails中使用bootstrap,由于某些原因,我的缩略图只在第2行而不是4行之前添加了一个项目。以下是截图:enter image description here

这是我的观点文件:

<div id="products_div">
<div class="container">
    <div class="jumbotron", id= "index">
        <h1>Nature inspired handicrafts and jewelry</h1> 

    </div>

       <% @products.each do |product| %>
        <div class="center-block">
           <div class="col-lg-3">
               <div class = "thumbnail row">
              <%= link_to product do %>
                 <%= image_tag product.image.preview.url, :size => "224.98x178.66" %>
                 <% end %>
             <p><%= product.name[0..30] + "..." %></p>
             <p><%= number_to_currency(product.price, :unit => '$') %></p>
         </div>
        </div>
        </div>
       <% end %>
 </div>
</div>

1 个答案:

答案 0 :(得分:0)

这是因为第一行的最后一个块高度与前三行不相等。 尝试使用'center-block'类

的最小高度