Design comparison
Solution retrospective
I am pleased that the final look closely matches the sample design. I know my code isn't perfect and has room for improvement. Next time, I want to write more efficient, effective, and clean code.
What challenges did you encounter, and how did you overcome them?Initially, I struggled to fit the image properly on the card, and when I adjusted the card's border-radius, the image's border remained unchanged. After researching the issue, I discovered the object-fit
property and set it to cover
, which resolved the problem. I also couldn't find the cart logo in the downloaded files as the image was missing so I downloaded one from Google, though it doesn't exactly match the design.
I want to know how to write cleaner and more efficient code. I know that the HTML structure could be improved, and I believe there are ways to make my CSS styling cleaner and more effective. I want to make the code more readable and easier to understand.
Community feedback
- @zololadePosted 2 months ago
- HTML: Your HTML is not semantic and you made use of a lot of
<div>
, this is not a good practice. To read more on semantic HTML and its importance, there are documentations on MDN - CSS: After checking your CSS I noticed you specified a width for your body
width: 1440px;
this is not useful there and you used padding to center your element, I advise you explore methods to do this such asdisplay: grid
ordisplay: flex
, you can find documentations on this on MDN.
0 - HTML: Your HTML is not semantic and you made use of a lot of
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