我正在使用Bootstrap4。如果我对img-fluid标签的mansory风格画廊做出响应。例如,第二张图像很长(与高度一样),并且与其他图像之间有很大的空间。我怎样才能做这个像这样的画廊,例如tumblr或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>
我不喜欢的答案,但我需要在这个慵懒的负荷。我已经尝试了很多,但我可以一起做这个,请帮助!
@media only screen and (min-width: 1100px) {
.masonry {
-moz-column-count: 4;
-webkit-column-count: 4;
column-count: 4;
}
}
@media only screen and (min-width: 900px) {
.masonry {
-moz-column-count: 3;
-webkit-column-count: 3;
column-count: 3;
}
}
@media only screen and (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>
你是最棒的工作谢谢你! – marlonjd
乐意提供帮助。 –
如何将此代码添加到lazyload org imgix.js?如果我启用延迟加载一切......你知道:D – marlonjd