<h1>CSS Grid example - No Feature Query</h1>
<div class="grid">
<div class="grid__item">
<img src="https://placekitten.com/1000/500" alt="" />
</div>
<div class="grid__item">
<img src="https://placekitten.com/600/800" alt="" />
</div>
<div class="grid__item">
<img src="https://placekitten.com/1000/800" alt="" />
</div>
<div class="grid__item">
<img src="https://placekitten.com/400/900" alt="" />
</div>
<div class="grid__item">
<img src="https://placekitten.com/900/1000" alt="" />
</div>
<div class="grid__item">
<img src="https://placekitten.com/1200/800" alt="" />
</div>
<div class="grid__item">
<img src="https://placekitten.com/2000/700" alt="" />
</div>
<div class="grid__item">
<img src="https://placekitten.com/1500/400" alt="" />
</div>
<div class="grid__item">
<img src="https://placekitten.com/1200/800" alt="" />
</div>
<div class="grid__item">
<img src="https://placekitten.com/2000/800" alt="" />
</div>
<div class="grid__item">
<img src="https://placekitten.com/1500/500" alt="" />
</div>
<div class="grid__item">
<img src="https://placekitten.com/300/500" alt="" />
</div>
</div>
.grid {
display: grid;
grid-template-rows: 1fr auto 1fr;
grid-template-columns: 1fr 1fr 2fr 1fr;
margin: auto;
width: 90%;
grid-column-gap: calc(5px + 1vw);
grid-row-gap: calc(5px + 1vw);
.grid__item {
height: calc(100px + 20vw);
&:nth-child(7) {
grid-column: span 2;
}
&:nth-child(8) {
grid-column: span 4;
}
}
img {
width: 100%;
height: 100%;
object-fit: cover;
object-position: top center;
}
}
h1 {
text-align: center;
font-size: calc(1em + 3vw);
margin: 0 0 calc(.3em + 2vw);
}
body {
font-family: 'Open Sans', sans-serif;
padding: 10px 0;
background-color: #eff6e0;
font-size: 16px;
}
View Compiled
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.