html - Bootstrap 行 - 删除元素会导致该行无法正确填充

标签 html css twitter-bootstrap

我正在开发一个使用 bootstrap 的 shopify 主题..

我需要显示一个没有问题的图像列表,列表显示正常。

但是,我需要删除一个特定的列表项,并且在执行此操作时,我得到了不稳定的结果...这是一个示例:

假设“--”是图片,当我选择不显示特定图片时出现第三行。

我已经查看了 Bootstrap 文档,但我认为我遗漏了一些东西。

     -- -- -- --
     -- -- -- --
              --
     -- -- -- --
     -- -- -- --

<div class="row seminar-row-two">
  {% for product in collections.stone-sculpture-gallery.products %}
  {% if product != 'john' %}
    {% assign productID = product.id %}
    {% assign productTitle = product.title %}
  <div class="col-xs-12 col-md-3 col-sm-6 gallery-image">
    {% for image in product.images %}
        {%if forloop.index == 1%}
        <a href="../products/{{product.handle}}"><img src="{{ image.src | product_img_url: 'medium' }}"> </a> 
        <p> <a href="../products/{{product.handle}}">{{product.handle}} </a> </p>
        {%endif%}
    {% endfor %}
  </div>
  {% endif %}
  {% endfor %}

最佳答案

所有列都被输入到一行中,这似乎是问题所在。每 4 个元素有一个新行应该可以解决这个问题。

关于html - Bootstrap 行 - 删除元素会导致该行无法正确填充,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33834162/

相关文章:

css - 我需要一些帮助来创建基于网格的网站

html - 添加与正文大小相同的元素时显示滚动条

html - 我的CSS来自哪里?

JQUERY 滑动门效果 - 适用于 jsFiddle 但不适用于 chrome

html - 是否可以让顶部边框在具有其他边框的元素中占据整个宽度?

javascript - 移动屏幕上导航栏的奇怪行为

jquery - 需要一个简单的可折叠小发明

javascript - htmlspecialchars_decode 导致宽度问题

iphone - 如何将网页方向修复为仅适用于 iPad 和 iPhone 的纵向?

html - 图片不会居中