"mesonry image gallery"
Bootstrap 4.1.1 Snippet by admanekishor

<link href="//maxcdn.bootstrapcdn.com/bootstrap/4.1.1/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css"> <script src="//maxcdn.bootstrapcdn.com/bootstrap/4.1.1/js/bootstrap.min.js"></script> <script src="//cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> <!------ Include the above in your HEAD tag ----------> <div class="container"> <header class="text-center"> <h1>Mesonry Image gallery</h1> </header> <div class="row"> <div class="col-md-8 col-sm-12 co-xs-12 gal-item"> <div class="row h-50"> <div class="col-md-12 col-sm-12 co-xs-12 gal-item"> <div class="box"> <img src="http://fakeimg.pl/758x370/" class="img-ht img-fluid rounded"> </div> </div> </div> <div class="row h-50"> <div class="col-md-6 col-sm-6 co-xs-12 gal-item"> <div class="box"> <img src="http://fakeimg.pl/748x177/" class="img-ht img-fluid rounded"> </div> </div> <div class="col-md-6 col-sm-6 co-xs-12 gal-item"> <div class="box"> <img src="http://fakeimg.pl/371x370/" class="img-ht img-fluid rounded"> </div> </div> </div> </div> <div class="col-md-4 col-sm-6 co-xs-12 gal-item"> <div class="col-md-12 col-sm-6 co-xs-12 gal-item h-25"> <div class="box"> <img src="http://fakeimg.pl/748x177/" class="img-ht img-fluid rounded"> </div> </div> <div class="col-md-12 col-sm-6 co-xs-12 gal-item h-75"> <div class="box"> <img src="http://fakeimg.pl/748x177/" class="img-ht img-fluid rounded"> </div> </div> </div> </div> <br/> </div>
.gal-item{ overflow: hidden; padding: 8px; } .gal-item .box{ height: 100%; overflow: hidden; } .box img{ height: 100%; width: auto; object-fit:cover; }

Related: See More


Questions / Comments: