Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found

Submitted

Responsive product card component using CSS Grid and Flexbox

Néstor 60

@nesc11

Desktop design screenshot for the Product preview card component coding challenge

This is a solution for...

  • HTML
  • CSS
1newbie
View challenge

Design comparison


SolutionDesign

Solution retrospective


What are you most proud of, and what would you do differently next time?

I think the way to approach the challenge is good, I mean that the mobile-first workflow helps a lot of in gradually adding just the necessary styles and preventing it from becoming a huge css file. For the next time I will try to declare more utilities classes because I think they are useful for larger projects.

What challenges did you encounter, and how did you overcome them?

The naming of the classes for HTML tags is always a problem for me, because I feel like I need to return to HTML file a lot of times just to remember the names, so I just declared the names based of what I see on the card.

What specific areas of your project would you like help with?

I think that I need help on the images, because the document is always loading both, the desktop and the mobile images, I just declare a media query to display the desktop image and hide the mobile image on larger screens, but I don't think this is the right approach.

Community feedback

Daniel 🛸 44,230

@danielmrz-dev

Posted

Hello @nesc11!

Your project looks great!

I have a suggestion about your code that might interest you:

📌 You can use the <picture> tag when you have different versions of the same image 🖼. Using the <picture> tag will help load the correct image to the user's device, saving bandwidth and improving performance.

Example:

<picture>
    <source media="(max-width: 460px)" srcset="{desktop image path here}">
    <img src="{mobile image path here}" alt="{alternative text here}">
</picture>

I hope this helps!

Other than that, excellent work!

Marked as helpful

1
MarieG41 210

@MarieG41

Posted

Nice job your solution is almost identical to the design !!

1

Please log in to post a comment

Log in with GitHub
Discord logo

Join 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