Four card feature section

Solution retrospective
Major learning for this project is the usage of grid-template-areas property.
Beside mobile first approach also helped me to design the page. All necessary properties are applied to elements at mobile first approach. And other properties (media query, grid-template-areas, :nth-child() ) applied when it is needed.
@media(min-width:900px){
.grid-container{
display: grid;
grid-template-columns: repeat(3,1fr);
/* grid-template-areas: arranging how cards to be laid out on page.
Could be thought as blueprint of layout
*/
grid-template-areas:
". two ."
"one two four"
"one three four"
". three .";
}
/* If card are defined outside of media query, they are overlapped */
.card:nth-child(1){
grid-area: one;
}
.card:nth-child(2){
grid-area: two;
}
.card:nth-child(3){
grid-area: three;
}
.card:nth-child(4){
grid-area: four;
}
}
What challenges did you encounter, and how did you overcome them?
The biggest challenge for me is the grid layout. This could be done by relocating the cards in grid layout by using span, grid-column etc.., but I assume this could take longer to code.
But of course, if you have enough tools in your toolbox you may have different solutions for any project.
What specific areas of your project would you like help with?Any feedback is welcome!
Please log in to post a comment
Log in with GitHubCommunity feedback
No feedback yet. Be the first to give feedback on korcakSEA's solution.
Join our Discord community
Join thousands of Frontend Mentor community members taking the challenges, sharing resources, helping each other, and chatting about all things front-end!
Join our Discord