Design comparison
Solution retrospective
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
- @danielmrz-devPosted 5 months ago
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 helpful1
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