Grid layout

Trying to achieve the layout with grid. I got stuck here.
<div class="images">
<img class="first" src="3.png" alt="" />
<img class="second" src="7.png" alt="" />
<img src="2.png" alt="" />
<img class="third" src="4.png" alt="" />
<img class="fourth" src="6.png" alt="" />
<img src="1.png" alt="" />
<img src="5.png" alt="" />
</div>
<div class="images">
<img class="first" src="3.png" alt="" />
<img class="second" src="7.png" alt="" />
<img src="2.png" alt="" />
<img class="third" src="4.png" alt="" />
<img class="fourth" src="6.png" alt="" />
<img src="1.png" alt="" />
<img src="5.png" alt="" />
</div>
.images {
width: 50%;
display: grid;
gap: 1.5rem;
grid-template-columns: repeat(3, 1fr);
}

.first {
grid-row: 1/2;
}

.second {
grid-row: 2/3;
}

.third {
grid-row-start: 2;
grid-row-end: 3;
}

.fourth {
grid-row-start: 3;
grid-column-start: 2;
}
.images {
width: 50%;
display: grid;
gap: 1.5rem;
grid-template-columns: repeat(3, 1fr);
}

.first {
grid-row: 1/2;
}

.second {
grid-row: 2/3;
}

.third {
grid-row-start: 2;
grid-row-end: 3;
}

.fourth {
grid-row-start: 3;
grid-column-start: 2;
}
No description
No description
5 Replies
Tok124 (CSS Nerd)
Tok124 (CSS Nerd)ā€¢2mo ago
Kevin Powell
YouTube
Masonry layout with CSS only!
The first 1000 people to use the link will get a free trial of Skillshare Premium Membership: https://skl.sh/kevinpowell12201 Masonry Layouts have been around forever now, and considering that they are surprisingly hard to actually implement. Well, not so much now that they are coming to CSS at last! It's still in the very early stages, only ...
Kypac
Kypacā€¢2mo ago
That was my actuall first search but didn't find this video lol
No description
Tok124 (CSS Nerd)
Tok124 (CSS Nerd)ā€¢2mo ago
https://www.youtube.com/watch?v=azs0xtt_tJc I meant to link this video xD
Kevin Powell
YouTube
What would you call this layout?
Read the full artcile here šŸ‘‰ https://webkit.org/blog/15269/help-us-invent-masonry-layouts-for-css-grid-level-3/ and Chrome has put out an alternate proposal I didn't mention in the video, which has the opposite point of view: https://developer.chrome.com/blog/masonry šŸ”— Links āœ… The full article: https://webkit.org/blog/15269/help-us-invent-mason...
Tok124 (CSS Nerd)
Tok124 (CSS Nerd)ā€¢2mo ago
I just call in pinterest layout. But yeah, use columns instead of grid
Kypac
Kypacā€¢2mo ago
Thanks!
Want results from more Discord servers?
Add your server