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

product review card

Justinā€¢ 100

@aduatgit

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 I did a good job starting from the mobile design and adjusting the desktop design afterwards. I did this layout with flex, but I think grid would have made things a bit easier when swapping from mobile to desktop.

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

I had a huge space at the bottom of the product information when on desktop, I bandaid fixed that by adjusting the flex-gap, but again, using grid would probably have solved this more elegantly. In general the spacing was quite weird to get right, in the end I didn't really bother to make things pixel perfect, especially because I wasn't working with a figma file.

I had some issue with the button shopping cart picture, but I managed to solve that using a pseudoelement. The problem that persisted was that it wasn't really centered, but I found out that you could use the image as a background instead of putting it in the content of the pseudoelement, that way it became centered.

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

Is it possible to use flex to fill up the right area (-> the product information) dynamically, without having to use gap and fixed heights and eyeballing it to get it right? I know it is possible with grid, but would really like to know if it is possible with flex.

Community feedback

Daniel šŸ›øā€¢ 44,230

@danielmrz-dev

Posted

Hello there!

Congrats on completing the challenge! āœ…

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="(min-width: 768px)" 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
Divyam Sharmaā€¢ 160

@Divyamsharma-18

Posted

Looks great buddy :) Keep it up!

0

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