.wrapper {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
grid-gap: 10px;
grid-auto-flow: dense;
list-style: none;
margin: 1em auto;
padding: 0;
max-width: 800px;
}
.wrapper li {
border: 1px solid #ccc;
}
.wrapper li.landscape {
grid-column-end: span 2;
}
.wrapper li img {
display: block;
object-fit: cover;
width: 100%;
height: 100%;
}
<ul class="wrapper">
<li><img src="https://placehold.it/200x300" alt="placeholder"></li>
<li class="landscape"><img src="https://placehold.it/350x200" alt="placeholder"></li>
<li class="landscape"><img src="https://placehold.it/350x200" alt="placeholder"></li>
<li class="landscape"><img src="https://placehold.it/350x200" alt="placeholder"></li>
<li><img src="https://placehold.it/200x300" alt="placeholder"></li>
<li><img src="https://placehold.it/200x300" alt="placeholder"></li>
<li class="landscape"><img src="https://placehold.it/350x200" alt="placeholder"></li>
<li><img src="https://placehold.it/200x300" alt="placeholder"></li>
<li><img src="https://placehold.it/200x300" alt="placeholder"></li>
<li><img src="https://placehold.it/200x300" alt="placeholder"></li>
</ul>
Code Example |
---|
Css :: close icon css |
Css :: expo vector icons install |
Css :: object-fit |
Css :: button edges rounded css |
Css :: css horizontal scroll cards |
Css :: css background properties |
Css :: how to add a background overlay in css |
Css :: hide overflow but still scroll |
Css :: center ul |
Css :: css pointer event |
Css :: css anchor fill parent |
Css :: first child css in material ui |
Css :: css bold |
Css :: why is my css code not working |
Css :: css gradient 3 colors |
Css :: css align backround image to the right |
Css :: jquery hide scrollbar but allow scrolling |
Css :: css style placeholder |
Css :: input type file without button |
Css :: bootstrap5 more usable screens |
Css :: cursor couleur in css |
Css :: css wrap |
Css :: how to write css in html |
Css :: import antd css |
Css :: Add Very Subtle Drop Shadow (CSS) To Element (HTML) |
Css :: aspect ratio css |
Css :: how to make a flex container full page |
Css :: selecting last child css |
Css :: css mutline comment |
Css :: css text overflow |