Design comparison
SolutionDesign
Solution retrospective
I felt using grid, width, and margin to get the desktop view was a bit hacky, please let me know if you found a better solution for the desktop layout, thanks!
Community feedback
- @nakoyawilsonPosted almost 3 years ago
Instead of doing a 3 column grid and specifying widths, I would suggest doing a 4 column grid and using span 2 for the wider boxes. I experimented with your code and used this to achieve the layout.
.flex-container { display: grid; grid-template-columns: repeat(4, 1fr); grid-template-rows: auto auto; max-width: 70rem; gap: 10px; align-items: stretch; } .boxes { margin: 0; } .box-1 { grid-column: span 2; } .box-4 { grid-column: span 2; } .box-5 { grid-column: 4 / 5; grid-row: 1 / 3; }
Marked as helpful2
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