Bootstrap grid with different image heights

隐身守侯 提交于 2019-12-02 00:01:49

You need to add something every 2 col-md-6 to ensure the left floats clear..

One way is to use Bootstrap's clearfix reset, another way is to use a CSS reset like this..

@media (min-width: 768px) {
    .row > .col-md-6:nth-child(2n+1) {
        clear: left;
    }
}

http://www.codeply.com/go/oAiZNlWgau

There are a few ways to achieve this.

Wrap each row into it's own row

<div class="row">
<div class="col-md-6>Content</div>
<div class="col-md-6>Content</div>
</div>

You can also set a min-height for each item, that way they will always be the same height.

Lastly, you can not use the bootstrap grid system and build your own grid by using display: inline-block; just be sure to set negative margin on each element and v-align to top.

Hope this helps :P

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!