Design comparison
Solution retrospective
Found this one quite a simple build. Had questions around whether or not to use background images as the source of the image for the perfume bottle (decided to go with bg images so I could change it based on a media query).
Really going hard on coding mobile first, as I'm finding the media queries are becoming much smaller.
Probably could do with tidying up the CSS a little bit, and maybe changing a couple of the class names so that they better represent the content but overall pretty happy with how this one turned out.
Community feedback
- @correlucasPosted about 2 years ago
👾Hello Michael East, congratulations for your new solution!
You did a good work putting everything together in this challenge, something you can do to improve the image that needs to change between mobile and desktop is to use
<picture>
instead of<img>
wrapped in a div.In this case its better you use and import the image by the HTML and not the css, because since its a product image, you'll need it optimized for SEO and adding this in the CSS as
background-image
its not the best choice to have the image found by the searching engines.You can manage both images inside the
<picture>
tag and use the html to code to set when the images should change setting the devicemax-width
depending of the device (phone / computer) Here’s a guide about how to usepicture
:https://www.w3schools.com/tags/tag_picture.asp
👋 I hope this helps you and happy coding!
Marked as helpful0@MrEasty94Posted about 2 years ago@correlucas Thanks Lucas, that was the one area I was unsure about, so I need to do more research on the picture tag, and how to make it dynamically change based on screen width.
Appreciate the advice.
0@DeolabestPosted about 2 years ago@correlucas Thanks. I find this helpful as well.
0 - @freakyjonesPosted about 2 years ago
Hi Michael,
congratulation on completing the challenge
I just saw your code and like to give you one suggestion
- instead of using an anchor tag on add cart, a button tag will be a better option for accessibility.
I hope it helps, Thanks Happy coding :)
0
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