Css Can';t使容器与细枝/引导一起正常工作

Css Can';t使容器与细枝/引导一起正常工作,css,twitter-bootstrap-3,Css,Twitter Bootstrap 3,我遇到了一些关于在引导下将一些盒子放在容器中的问题 这是我的代码: <div class="container-fluid"> <div class="row"> {% for post in posts %} <div class="col-md-6"> {% include "@CurationBlog/Default/cards/card_de

我遇到了一些关于在引导下将一些盒子放在容器中的问题

这是我的代码:

<div class="container-fluid">
        <div class="row">
            {% for post in posts %}
                <div class="col-md-6">
                    {% include "@CurationBlog/Default/cards/card_default.html.twig" %}
                </div>
            {% endfor %}
        </div>
    </div>

{posts%%中的post为%s}
{%include“@CurationBlog/Default/cards/card_Default.html.twig”%}
{%endfor%}
所以我多次调用我的card_default,它只是一篇带有图片和一些主体的文章。代码如下:

<div class="ibox">
<div class="ibox-content col-md-12 row-eq-height box-post">
    <div class="col-md-4 img-col">
        <img style="max-height: initial" class="img-responsive" src='{{ post.illustrationUrl }}'>
    </div>
    <div class="col-md-8 border-body" style="background-color: white; padding: 15px;">
        <h3 id="post-title" style="margin-top: 0;">
            <a href="{{ path('curation_blog_redirect_to_post', {'id': post.id}) }}" rel="noopener noreferrer" target="_blank" style="color: black;">
                {{ post.title }}
            </a>
        </h3>
        <div class="small m-b-xs">
            <strong>{{ post.author }}</strong> &middot; <span class="text-muted">{{ post.source }}</span>
        </div>
        <p id="description">{{ post.summary }}</p>
        <p><i class="fa fa-clock-o" aria-hidden="true"></i> {{ 'university.body.reading_time'|transchoice(post.readingTimeMinutes) }}</p>
        <div>
            {% for tag in post.tags %}
                <button class="btn btn-white btn-xs" type="button" style="margin-top: 3px;">{{ tag.name }}</button>
            {% endfor %}
        </div>
    </div>
</div>

{{post.author}·;{{post.source}}

{{post.summary}

{{“大学.身体.阅读时间”{124;跨选择(post.readingTimeMinutes)}

{post.tags%中标记的%s} {{tag.name} {%endfor%}

所以我找不到任何错误,但呈现的页面如下所示:

是的,图像也被破坏了,但这是另一个问题

如果你有任何想法,我在听

编辑:忘了精确说明我的第一个div的宽度和高度:

使用此html

在再次使用col-*类划分屏幕之前,需要使用row

<div class="ibox">
  <div class="row">
    <div class="ibox-content col-md-12 row-eq-height box-post">
      <div class="row">
        <div class="col-md-4 img-col">
          <img style="max-height: initial" class="img-responsive" src='{{ post.illustrationUrl }}'>
        </div>
        <div class="col-md-8 border-body" style="background-color: white; padding: 15px;">
          <h3 id="post-title" style="margin-top: 0;">
            <a href="{{ path('curation_blog_redirect_to_post', {'id': post.id}) }}" rel="noopener noreferrer" target="_blank" style="color: black;">
                  {{ post.title }}
              </a>
          </h3>
          <div class="small m-b-xs">
            <strong>{{ post.author }}</strong> &middot; <span class="text-muted">{{ post.source }}</span>
          </div>
          <p id="description">{{ post.summary }}</p>
          <p><i class="fa fa-clock-o" aria-hidden="true"></i> {{ 'university.body.reading_time'|transchoice(post.readingTimeMinutes) }}</p>
          <div>
            {% for tag in post.tags %}
            <button class="btn btn-white btn-xs" type="button" style="margin-top: 3px;">{{ tag.name }}</button> {% endfor %}
          </div>
        </div>
      </div>
    </div>
  </div>
</div>

{{post.author}·;{{post.source}}

{{post.summary}

{{“大学.身体.阅读时间”{124;跨选择(post.readingTimeMinutes)}

{post.tags%中标记的%s} {{tag.name}{%endfor%}

{{post.author}·;{{post.source}}

{{post.summary}

{{“大学.身体.阅读时间”{124;跨选择(post.readingTimeMinutes)}

{post.tags%中标记的%s} {{tag.name}{%endfor%} {{post.author}·;{{post.source}}

{{post.summary}

{{“大学.身体.阅读时间”{124;跨选择(post.readingTimeMinutes)}

{post.tags%中标记的%s} {{tag.name}{%endfor%} {{post.author}·;{{post.source}}

{{post.summary}

{{“大学.身体.阅读时间”{124;跨选择(post.readingTimeMinutes)}

{post.tags%中标记的%s} {{tag.name}{%endfor%}
如果不在网上看到这一点,我无法准确地说出来,但我想这与您的iBox具有不同的高度有关。如果您无法将相同的高度应用于所有这些对象,请尝试以下方法:

<div class="container-fluid">
    {% for i,post in posts %}
        {% if i%2 == 0 %}<div class="row">{% endif %}
        <div class="col-md-6">
           {% include "@CurationBlog/Default/cards/card_default.html.twig" %}
        </div>
        {% if i%2 == 0 %}</div>{% endif %}
    {% endfor %}
</div>

{%i,在posts%}
{%if i%2==0%}{%endif%}
{%include“@CurationBlog/Default/cards/card_Default.html.twig”%}
{%if i%2==0%}{%endif%}
{%endfor%}

如果我在.ibox内容之后添加一行,我的图像现在会被裁剪,看起来不会改变任何东西,对我来说效果很好。添加了一个代码段,将在一段时间内添加图像,我还添加了2行。1 after.ibox_content和1 after.ibox您使用哪种引导?如果可能,请尝试使用引导4。或者尝试添加此样式。行{display:flex;flex wrap:wrap;}我不能具有相同的高度,工作限制:/