Design comparison
SolutionDesign
Solution retrospective
I would request you to please review my code for the card component and let me know the ways I can optimize it more. Please check the desktop and mobile responsiveness and if you know any other ways to do so, do share. Your suggestions and feedback is valuable for me!
Community feedback
- Account deleted
Hey @shreyachoure,
Great job on your first challenge. Here are a few ways you could optimize your solution
- The
body
tag comes with default margin(8px). This causes the mobile version of your solution to have unnecessary space. You can remove the margin by setting themargin
property to0
inside the body tag
body{ margin: 0; }
- At this point your cards are not fully stretched out in response to the window. To make each card fully stretch, so that it takes up all the space in mobile view. Remove your width specification.
@media screen and (min-width: 321px) and (max-width: 1024px) { .cars { flex-direction: column; margin-left: auto; margin-right: auto; } ... }
- I'm not sure you are aware of this but the media query
@media screen and (min-width: 321px) and (max-width: 1024px) {...}
will apply its properties when the window size is larger than 321px & smaller than 1024px. Meaning that if I were to open your website on a device that is smaller then 321px I would see the desktop version of your design. I would suggest having this media query only set to@media screen and (max-width: 1024px)
Hope that helps, good luck on your next challenge 😉
//Kenny
0 - The
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