html - How can I do mansory style or something like this image area -


i'm using bootstrap4. if responsive mansory style gallery img-fluid tag. example, second image long(as height) , there space other images. how can gallery these example tumblr or pexels.com ?

 <div class="row">              <div class="col-md-4">                     <img class="img-fluid" src="https://d1p5m9g4zcqpp8.cloudfront.net/photos/popular/buffalo-nature-animals-animal-green.jpg">             </div>             <div class="col-md-4">                     <img class="img-fluid" src="https://pixellous.imgix.net/animals/africa-african-animal-cat-41315.jpeg">             </div>             <div class="col-md-4">                     <img class="img-fluid" src="https://d1p5m9g4zcqpp8.cloudfront.net/photos/popular/landscape-dark-view-nature.jpg">             </div>             <div class="col-md-4">                     <img class="img-fluid" src="https://d1p5m9g4zcqpp8.cloudfront.net/photos/popular/lifts-technology-lift-black-and-white.jpg">             </div>             <div class="col-md-4">                     <img class="img-fluid" src="https://d1p5m9g4zcqpp8.cloudfront.net/photos/popular/man-black-and-white-excited.jpg">             </div>             <div class="col-md-4">                     <img class="img-fluid" src="https://d1p5m9g4zcqpp8.cloudfront.net/photos/popular/spices-salt-pepper-spoon.jpg">             </div>         </div> 

i did answer need lazy load on this. i've tried please help!

@media screen , (min-width: 1100px) {    .masonry {      -moz-column-count: 4;      -webkit-column-count: 4;      column-count: 4;    }  }    @media screen , (min-width: 900px) {    .masonry {      -moz-column-count: 3;      -webkit-column-count: 3;      column-count: 3;    }  }    @media screen , (min-width: 700px) {    .masonry {      -moz-column-count: 2;      -webkit-column-count: 2;      column-count: 2;    }  }    .masonry {    margin: 1.5em 0;    padding: 0;    -moz-column-gap: 1.5em;    -webkit-column-gap: 1.5em;    column-gap: 1.5em;    font-size: .85em;  }    .item {    background-color: #eee;    display: inline-block;    margin: 0 0 1em;    width: 100%;  }    .item img {    max-width: 100%;    height: auto;    display: block;  }
<div class="masonry">    <div class="item">      <img class="img-fluid" src="https://d1p5m9g4zcqpp8.cloudfront.net/photos/popular/buffalo-nature-animals-animal-green.jpg">    </div>    <div class="item">      <img class="img-fluid" src="https://pixellous.imgix.net/animals/africa-african-animal-cat-41315.jpeg">    </div>    <div class="item">      <img class="img-fluid" src="https://d1p5m9g4zcqpp8.cloudfront.net/photos/popular/landscape-dark-view-nature.jpg">    </div>    <div class="item">      <img class="img-fluid" src="https://d1p5m9g4zcqpp8.cloudfront.net/photos/popular/lifts-technology-lift-black-and-white.jpg">    </div>    <div class="item">      <img class="img-fluid" src="https://d1p5m9g4zcqpp8.cloudfront.net/photos/popular/man-black-and-white-excited.jpg">    </div>    <div class="item">      <img class="img-fluid" src="https://d1p5m9g4zcqpp8.cloudfront.net/photos/popular/spices-salt-pepper-spoon.jpg">    </div>  </div>

pure css version of responsive masonry, no plugin or script used.

@media screen , (min-width: 1100px) {    .masonry {      -moz-column-count: 4;      -webkit-column-count: 4;      column-count: 4;    }  }    @media screen , (min-width: 900px) {    .masonry {      -moz-column-count: 3;      -webkit-column-count: 3;      column-count: 3;    }  }    @media screen , (min-width: 700px) {    .masonry {      -moz-column-count: 2;      -webkit-column-count: 2;      column-count: 2;    }  }    .masonry {    margin: 1.5em 0;    padding: 0;    -moz-column-gap: 1.5em;    -webkit-column-gap: 1.5em;    column-gap: 1.5em;    font-size: .85em;  }    .item {    background-color: #eee;    display: inline-block;    margin: 0 0 1em;    width: 100%;  }    .item img {    max-width: 100%;    height: auto;    display: block;  }
<div class="masonry">    <div class="item">      <img class="img-fluid" src="https://d1p5m9g4zcqpp8.cloudfront.net/photos/popular/buffalo-nature-animals-animal-green.jpg">    </div>    <div class="item">      <img class="img-fluid" src="https://pixellous.imgix.net/animals/africa-african-animal-cat-41315.jpeg">    </div>    <div class="item">      <img class="img-fluid" src="https://d1p5m9g4zcqpp8.cloudfront.net/photos/popular/landscape-dark-view-nature.jpg">    </div>    <div class="item">      <img class="img-fluid" src="https://d1p5m9g4zcqpp8.cloudfront.net/photos/popular/lifts-technology-lift-black-and-white.jpg">    </div>    <div class="item">      <img class="img-fluid" src="https://d1p5m9g4zcqpp8.cloudfront.net/photos/popular/man-black-and-white-excited.jpg">    </div>    <div class="item">      <img class="img-fluid" src="https://d1p5m9g4zcqpp8.cloudfront.net/photos/popular/spices-salt-pepper-spoon.jpg">    </div>  </div>


Comments

Popular posts from this blog

c# - Update a combobox from a presenter (MVP) -

How to understand 2 main() functions after using uftrace to profile the C++ program? -

How to put a lock and transaction on table using spring 4 or above using jdbcTemplate and annotations like @Transactional? -