Design comparison
Solution retrospective
I can't set all the items as in the example, any suggestion or idea will be appreciated!
Community feedback
- @aimdexterPosted over 3 years ago
hey @Anderson Vallejo i made some changes to your code you can check it out :
1. Live
2. code
3. changes : ```@media (min-width: 1440px) {
.container__cards {
display: grid; column-gap: 20px; grid-auto-flow: dense; grid-template-columns: repeat(4, 1fr); grid-template-rows: repeat(2, 1fr); width: 70%;
}
.card--color-violet {
grid-area: 1/1/2/3;
}
.card--color-grayblue {
grid-area: 1/3/2/4;
}
.card--color-white {
grid-area: 1/4/3/5;
}
.card--color-white1 {
grid-area: 2/1/3/2;
}
.card--color-blackblue {
grid-area: 2/2/3/4;
}
} ```
4. I added a new class '.card--color-white1' both in the html file and css.
Marked as helpful2@VallejoandersonPosted over 3 years ago@aimdexter Hi, Almada, very useful solution without using grid-template-areas. It helps me a lot to see multiple solutions for the same problem, greetings and happy coding!
1 - @palgrammingPosted over 3 years ago
Look into Grid-template-areas they should help to solve your problems being able to easy rearrange the cards https://www.smashingmagazine.com/understanding-css-grid-template-areas/
Marked as helpful1@VallejoandersonPosted over 3 years ago@palgramming Hi, Patrick, thanks for your comment and help. I've added a media queary with a grid-template-area for the case 1410px or more, greetings!
0
Please log in to post a comment
Log in with GitHubJoin 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