lundi 10 décembre 2018

Masonry layout with foreach?

I'm making a layout with laravel that I paste all the posts on the page with a detemined layout. The code works, but I wanted to use a masonry style layout. How can I do this?

@foreach($posts as $post)
    <div class="col-lg-12">
        <!-- Post-->
        <article class="post">
            <div class="post-background" data-background="">
            <div class="post-header">
                <h2 class="post-title"><a href="blog-single.html"></a></h2>
                <ul class="post-meta h5">
                    <li>November 18, 2016</li>
                    <li><a href="#">Branding</a>, <a href="#">Design</a></li>
                    <li><a href="#">3 Comments</a></li>
                </ul>
            </div>
            <a class="post-background-link" href="blog-single.html"></a>
        </div>
        </article>
    <!-- Post end-->
    </div>
@endforeach
    <div class="col-lg-6">
    <!-- Post-->
        <article class="post">
            <div class="post-background" data-background="assets/images/blog/14.jpg">
                <div class="post-header">
                    <h2 class="post-title"><a href="blog-single.html">Bluetooth Speaker</a></h2>
                    <ul class="post-meta h5">
                        <li>November 18, 2016</li>
                        <li><a href="#">Branding</a>, <a href="#">Design</a></li>
                        <li><a href="#">3 Comments</a></li>
                    </ul>
                </div>
                <a class="post-background-link" href="blog-single.html"></a>
            </div>
        </article>
    <!-- Post end-->
    </div>



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire