html - (Bootstrap) 使列统一显示为内联 block

标签 html css twitter-bootstrap twitter-bootstrap-3

我正在努力使网站拥有一组漂亮的栏目。现在,除非文本的长度完全相同(图片的高度完全相同),否则网站会显示巨大的空白区域。下图显示了一些用于测试主题的虚拟产品。

enter image description here

我无法让元素正确对齐。这是拉取产品的 HTML 循环:

<div class="container-fluid lg-container">
<div class="row">
<div class="container-fluid">
{bundle = filter(pages, 'product') }
            <div class="row row-body row-margin-bottom no-padding">
            { foreach item in bundle }

                <div class="col-xs-12 col-sm-6 col-md-4" data-category="view">
                <div class="lib-panel">
                        <div class="lib-header">
                            <a href="#">{{ item.title }}</a>
                        </div>
                    <div class="row xsm-catpad ">
                        <a href="{ item.url }" >
                        <img src="http://xpenology.org/wp-content/themes/qaengine/img/default-thumbnail.jpg" class="lib-img-show img-responsive" />
                        </a>
                            <div class="lib-desc">
                                <p{ item.content }...</p>
                            </div>
                       <div class="col-xs-12">
                            <a href="{{ item.url }}" title="{{ item.meta.title }}"><button class="btn christmas">Check it out</button></a>
                       </div>
                        </div>
                </div>
            </div>
    {% endfor %}
    </div>
    </div>
    </section>
      </div><!-- /.row -->
    </div>

这是一些 CSS,我希望我包含了需要的内容,但它是一个大文件:

.row-body 
{
    padding: 0;
    margin: 0px;
}
.lib-panel {
    margin-bottom: 20Px;
}
.lib-panel img {
    width: auto;
    background-color: transparent;
}

#md-img{
    width: auto;
}
.lib-panel .row,
.lib-panel .col-md-6 .col-sm-6 .col-sm-4 .col-md-4 .col-sm-3 .col-md-3{
    padding: 0;
}

.lib-panel .lib-wide-row {
    padding: 0 0 0 0;
}

.lib-panel .lib-header {
    text-align: center;
    font-size: 20px;
    padding: 10px 5px 0 5px;
}
@media (max-width: 768px) and (min-width: 300px) {
    .lib-panel .lib-header {
    font-size: 40px;
    }
    .row .row .xsm-catpad{
    width: 80%;
    margin: auto;
    }
body {padding-bottom: 125px;}
}

.lib-panel .lib-row.lib-mini-header {
    text-align: justify;
    font-size: 16px;
    padding: 5px 0px 0 0px;
}
.lib-panel .lib-row.lib-ad-header {
    text-align: left;
    font-size: 16px;
    padding: 5px 0px 0 0px;
}

.lib-panel .lib-row.lib-desc {
    position: relative;
    height: 100%;
    display: block;
    font-size: 12px;
}
.lib-desc p{
     font-size: 14px;
    text-align: justify;
}

.lib-panel .lib-wide-row.lib-wide-desc {
    height: 100%;
    font-size: 12px;
}
.lib-panel .lib-row.lib-desc a{
    position: absolute;
    width: 100%;
    bottom: 10px;
    left: 20px;
}

.row .row .xsm-catpad{
width: 80%;
margin: auto;
}

最佳答案

呃,我需要做的就是添加这个

.row {
  display: flex;
  flex-wrap: wrap;
}

一切都立即修复了。

关于html - (Bootstrap) 使列统一显示为内联 block ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40326861/

相关文章:

php - 随机 <a> 标签不会消失

javascript - 为什么 Bootstrap 的 scrollspy 不起作用?

javascript - 将 eventListener 或 attachEvent 添加到 Electron 中的 anchor 标记的正确方法是什么?

jquery - 搜索功能无法选择的文本

html - 为什么单击的项目没有在下拉列表中被选中,而是始终显示标题文本

css-transitions - :active 框阴影上的 CSS3 过渡

html - 什么是 xml 建议的 url

html - 错误错误 : StaticInjectorError(AppModule)[StorieControllerComponent -> DataService]:

html - 如何使用 Bootstrap 带在列表项之间添加间隙并使它们长度相等

jquery - 为什么拆分按钮下拉菜单将选项隐藏在单元格后面?