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

Responsive Product card with CSS and HTML

Orlando 60

@LizardyOrlando

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 did this new project. If I can make something better, don't be afraid to correct me

Community feedback

@asbhogal

Posted

Hi Orlando, great work! The design matches the mockup nicely. I've noticed a few things however that are worth mentioning:

  • In your markup, your img alt doesn't have a value. Also, in relation to this, your images should be handled with the <picture> element with paths to both the mobile and desktop versions, which change depending on a specified viewport width. Here's a link from MDN on how to achieve this Link
  • Because of the explicit margin values you've set globally, your content shifts to the left at viewport widths <= 789px. If you remove these values and replace it with 0 auto across all widths, this will centralise your .card horizontally.
  • Avoid using id for elements as these are a higher specificity, which makes it difficult to style with classes and often ends up involving overriding them
  • Locally host your Google Fonts for privacy and performance reasons. Here's a good link explaining how to do this Link
  • Your font-size value should be in rem not px for accessibility reasons. Here's a link explaining in further detail Link

Hope this helps!

Marked as helpful

0

Orlando 60

@LizardyOrlando

Posted

@asbhogal thanks for your help. It's been so helpful for me

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