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 Component (HTML | CSS)

#bem

@krutagna10

Desktop design screenshot for the Product preview card component coding challenge

This is a solution for...

  • HTML
  • CSS
1newbie
View challenge

Design comparison


SolutionDesign

Community feedback

Elaine 11,420

@elaineleung

Posted

Hi Krutagna, first off, great job in making this solution responsive, and I also think you did many things well here, including how you used grid and also relative units instead of pixels.

About your question on good CSS practices, here's a short list on what I consider to be good practices in general:

  • Always include reset or normalize rules in your stylesheet to ensure your styles are consistent across different browsers and won't be overridden by the browser's default styles
  • A mobile-first approach is better than a desktop-first approach!
  • Regarding units, always try to use relative units such as rems and ems instead of pixels, especially for font sizes. Using percentages and viewport units for widths and heights should be taken with caution, as sometimes they might only look optimal for a certain browser width
  • It's best to use classes instead of id selectors to avoid specificity issues
  • It's important to give meaningful names to your classes, which I think you've done fairly well in your solution!

Hope this helps you out a bit, and great work in general!

Marked as helpful

1

@krutagna10

Posted

@elaineleung Okay, thank you very much

1
P
klyvoon 110

@klyvoon

Posted

For the image media query, you can choose the HTML picture tag.

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