【发布时间】:2015-02-17 10:44:47
【问题描述】:
我的问题是我想使用 bootstrap 3 网格系统以块格式显示数据,但是我不希望从高度限制到上一行的烦人的空白间隙。例如,如果我这样做:
<div class="row">
<div class="col-lg-4">post</div>
<div class="col-lg-4">longer post that is going to take more height than the others</div>
<div class="col-lg-4">post</div>
</div>
<div class="row">
<div class="col-lg-4">post</div>
<div class="col-lg-4">post</div>
<div class="col-lg-4">post</div>
</div>
然后我将在两行之间留下空白,我想要实现的是砖石效果(柱子填充位于其上方柱子附近),仅使用 CSS,特别是 bootstrap 3 网格系统。即:
我知道这可以通过plugins 完成,但我想看看是否有更纯粹的(即使它必须是 hacky)解决方案。有什么想法吗?
【问题讨论】:
-
Aibrean 建议的方式和上面的链接将框按列顺序排列,而不是按框顺序排列,Masonry 将它们放在合适的位置,虽然不是按顺序排列,但有时很接近。
-
@BootstrapBoogie-Christina 我喜欢那个链接,但是它并没有真正使用 bootstrap 3 网格系统,我整理了一个小提琴:jsfiddle.net/vtanz6xc/2 但是它仍然使用列系统,我想这现在必须工作。
标签: css twitter-bootstrap masonry