@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%
ormin-width: 100%
is way more responsive then justwidth: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 likerem
orem
, 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 likerem
orem
,
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
@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!
@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