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

@isaacfleurivil

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


I struggled to make the project responsive, I couldn't change the image div width to match the container div. What are some best practices? What better elements could I have used instead of the ones I've used in this project?

Community feedback

T
Josh 400

@burrijw

Posted

Hi Isaac, this is a great start! There are a couple accessibility issues you should address.

  • You need a <main> tag and all content should be inside landmarks where possible. Landmarks on W3Schools
  • You should have the image in your markup. It's meaningful to the page content because it's showing the product described by the text. Try adding it with the <picture> element to serve different images responsively and have an alt="" attribute.
  • Use a button for the "Add to Cart" button. Never use a div as an interactive element.

Marked as helpful

2
P
Cuong Ly 180

@cuonglyy

Posted

Hello Isaac!

Congrats on finishing this challenge! Here are some suggestions:

  • Try using semantic HTML to convey the structure of your document. For instance, you can change <div class="wrapper"> to <main class="main-content">, and <div class="attribution"> to <footer class="attribution">
  • Instead of adding the <svg> element into HTML, you can reference it by using the <img> element: <img src="./images/icon-cart.svg" alt="Shopping cart"> (Remember to provide an alt for accessibility!)

Hope this helps! Happy coding! (-:

Marked as helpful

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