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

Kyle 50

@kylecreate

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


What are you most proud of, and what would you do differently next time?

I'm proud that I was able to solve some small issues that I came across with my code and managed to make it look similar/close to the actual picture.

What challenges did you encounter, and how did you overcome them?

The 2 images of Desktop and Mobile. I overcame this by doing a display of none on the second image while in mobile size and vice versa.

What specific areas of your project would you like help with?

Anything! If you have any feedback, please feel free to post it!

Community feedback

P
Steven Stroud 4,120

@Stroudy

Posted

Hey, You scored 100 in all four categories in lighthouse, Great job with this solution you should be proud, A few things I noticed,

  • When above 600px screen size your card component breaks, You can fix this by using @media queries,
  • Setting a height and width attribute to your <img> will increase performance to reduce layout shifts and improve CLS, It reserves the space on the page for the image,
  • This made me laugh, I will let you figure out why 🤣 see below
<meta name="description" content="freeCodeCamp Product Preview Card">
  • ‍Using max-width: 100% or min-width: 100% is way more responsive then just width:100%, check out this article also from the same Frontend mentor dev responsive-meaning, she goes into more detail.
  • You should avoid using px as it is an absolute unit and not a responsive unit like rem or em, You should look at this article from a Frontend mentor dev, Why font-size must NEVER be in pixels.
  • Another great resource for px to rem converter.
  • Having better alt="" descriptions for accessibility is a must check this out Write helpful Alt Text to describe images,
  • You should apply a full modern reset to make things easier as you build, check out this site for a Full modern reset
  • Using a naming convention like BEM, Using proper naming will prepare you for the changes in design of the website.
  • @media should also be in relative units like rem or em,

I hope you found some of this information helpful, You should give the articles a good read and I look forward to seeing some more from you, Happy coding! 💻

Marked as helpful

1

Kyle 50

@kylecreate

Posted

@Stroudy Thank you for your helpful tips! I went back and changed a lot of parts in the CSS. That description meta I didn't even catch for some reason, my mind must've been on autopilot! That was pretty funny, but I did fix that. Thanks again!

1
P
Steven Stroud 4,120

@Stroudy

Posted

@kylecreate, I’m thrilled you’re finding this advice helpful! You’re doing an amazing job, so keep up the hard work. Remember, every line of code is a step closer to mastery. Stay motivated and keep 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