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

Perfume Product Preview Card

Michael Eastβ€’ 40

@MrEasty94

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


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

Lucas πŸ‘Ύβ€’ 104,580

@correlucas

Posted

πŸ‘Ύ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 device max-width depending of the device (phone / computer) Here’s a guide about how to use picture: https://www.w3schools.com/tags/tag_picture.asp

πŸ‘‹ I hope this helps you and happy coding!

Marked as helpful

0

Michael Eastβ€’ 40

@MrEasty94

Posted

@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
Adeola Ganiuβ€’ 1,320

@Deolabest

Posted

@correlucas Thanks. I find this helpful as well.

0
Abhilashpandeyβ€’ 270

@freakyjones

Posted

Hi Michael,

congratulation on completing the challenge

I just saw your code and like to give you one suggestion

  1. 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 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