简体   繁体   English

如何在引导程序中按列而不是行对齐

[英]How to align by columns, not rows, in bootstrap

I've been having a lot of trouble finding out how to align my site this way using a grid system and could not find any questions regarding this when I searched. 我一直在寻找如何使用网格系统以这种方式对齐我的网站时遇到很多麻烦,并且在搜索时找不到与此相关的任何问题。

I essentially want my site to layout like this , but when using Bootstrap's grid system like: 我本质上希望我的网站像这样布局,但是在使用Bootstrap的网格系统时,例如:

<div class="row">
    <div class="col s3">
        ....
    </div>
    <div class="col s9">
        ....
    </div>
</div>

If any content in the second column extends past the first it shifts the whole page down. 如果第二列中的任何内容超出第一列,则将整个页面下移。 Any ideas? 有任何想法吗? I don't want the second column heights to be restricted by the bounds set by the first column. 我不希望第二列的高度受到第一列设置的边界的限制。

Bootstrap does not offer this functionality. Bootstrap不提供此功能。 You could achieve this effect using Masonry.js . 您可以使用Masonry.js达到此效果。 Take a look at this jQuery plugin. 看看这个jQuery插件。 It should do the trick. 它应该可以解决问题。

http://masonry.desandro.com/ http://masonry.desandro.com/

It is very well documented and easy to implement. 它有很好的文档记录,易于实现。 Good luck! 祝好运!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM