Twitter bootstrap 3 查询结果有时无法正确显示

Twitter bootstrap 3 查询结果有时无法正确显示,twitter-bootstrap-3,laravel-5,Twitter Bootstrap 3,Laravel 5,结果如下所示 我怎样才能使它们以3行的形式出现,并且没有偏移 代码: 缺少行标记: 这不太管用,因为它提出了一个完整的其他问题,第一个结果出现在它自己的行中。 @foreach ($posts as $post) <div class="col-md-4 portfolio-item"> <a href="/stories/{{ $post->slug }}#disqus_thread">

结果如下所示

我怎样才能使它们以3行的形式出现,并且没有偏移

代码:

缺少行标记:


这不太管用,因为它提出了一个完整的其他问题,第一个结果出现在它自己的行中。
        @foreach ($posts as $post)
        <div class="col-md-4 portfolio-item">
            <a href="/stories/{{ $post->slug }}#disqus_thread">
                <img class="img-responsive" src="http://placehold.it/700x400" alt="">
            </a>
            <h3>
                <a href="/stories/{{ $post->slug }}#disqus_thread">{{ str_limit($post->title, 34) }}</a>
            </h3>
            <p>{{ str_limit($post->content) }}</p>
            <em>({{ $post->published_at->format('M jS Y g:ia') }})</em>
        </div>
        @endforeach
body {
    background-image: url("http://www.ruschgaming.tv/img/bg.png");
    background-attachment: fixed;
    background-repeat: no-repeat;
}

.portfolio-item {
    margin-bottom: 25px;
}

.container {
    margin-top: 80px;
    padding-top: 20px;
    height: 100%;
    background-color: #ffffff;
    border-radius: 12px;
    box-shadow: 2px 2px 5px grey;
}
@foreach ($posts as $key => $post)
    @if(($key==0) || is_int($key/3))
        <div class="row">
    @endif
    <div class="col-md-4 portfolio-item">
        <a href="/stories/{{ $post->slug }}#disqus_thread">
            <img class="img-responsive" src="http://placehold.it/700x400" alt="">
        </a>
        <h3>
            <a href="/stories/{{ $post->slug }}#disqus_thread">{{ str_limit($post->title, 34) }}</a>
        </h3>
        <p>{{ str_limit($post->content) }}</p>
        <em>({{ $post->published_at->format('M jS Y g:ia') }})</em>
    </div>
    @if(is_int($key/3))
        <div>
    @endif
    @endforeach