Design comparison
Solution retrospective
I'm proud of being able to use CSS Grid to accomplish the component versus Flex. I definitely use Flex more because I am more comfortable with using it - so using Grid helped to challenge me with completing the component. Another thing that I'm proud of is actually using Paint 3D and the Photo tool with Windows to markup the design files to get the layout that I wanted to achieve with Grid. It is definitely something that I should've used earlier to get better at visualizing and creating layouts with Flex and/or Grid.
What specific areas of your project would you like help with?I wonder if a media query was necessary to get the components to wrap at smaller screen sizes. I did the following to make the components take up all the available space on mobile screen sizes:
@media (width < 426px) { .wrapper { margin-block: 1rem; & > * { grid-column: span 2; } } }
What I tried was to initially do was grid-template-columns: repeat(auto-fit, minmax(320px, 1fr);
to get it to wrap, but found that the components would not wrap or some components (specifically the pricing) would end up larger than the others. Is there a better function or unit to use inside the repeat()
function to accomplish the mobile design without a media query?
Community feedback
- @IvaBasPosted 6 months ago
Hi there, i just did like this, simple and it works good :) Kind regards! @media only screen and (min-width: 320px) and (max-width: 839px) { .container { margin: 10rem auto; grid-template-areas: "box1" "box2" "box3"; } }
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