我有一个图像模型,每个图像都有相关条目,它们也是图像。我想根据它们的数量连续显示相关的三个条目。我正在使用 Bootstrap 。
这是我到目前为止写的:
<% @image.related_entries.each.in_groups_of(3, false).each_with_index do |entry_row, i|
<div class="row_thumbnails">
# In row 1 I want 3 entries(images displayed in thumbnail look)
</div>
<%end%>
最佳答案
将图像放在使用 Bootstrap 列类的 div 中。 Bootstrap 容器有 12 列宽,因此您可以将它们放在 col-md-4
类中,每 3 张图像总共有 12 列。 Info on the bootstrap grid system.
关于css - 鉴于我使用的是 Bootstrap ,如何连续显示三个图像?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39432072/