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 preview card component using flexbox and vanilla CSS

@ticiadev

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


How can I improve my CSS to follow best practices? Which libraries or frameworks would make this challenge easier or more efficient?

Community feedback

@GelcimarMoraes

Posted

Hi, @hydrx Congratulations on finishing this project. 🎉🎊You have a great solution there!

Here are my suggestions for you:

  1. Something you can do to improve the image that needs to switch between mobile desktop and use <picture> instead of <img> inside a div. For reasons of SEO difficulty and search engines like Google and b localization, it is not a good practice to import this product image with CSS as this will cause an image of the image in google. You can manage both as inside the <picture> tag and use the html to set when images should, configure the max-width device moved from the device (mobile/desktop) Here is a guide on how to use picture: w3schools
  1. The element embed must not appear as a descendant of the button element.

I would build the button like this:

<button class="btn"><img src="images/icon-cart.svg" width="25" height="15" alt="shopping cart icon">Add to Cart</button> w3schools

✌️ I hope this helps you and happy coding!

Marked as helpful

1

@ticiadev

Posted

@GelcimarMoraes Thanks so much for your feedback! I updated my code with your suggestions, and will continue to keep them in mind for future projects.

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