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 solution

#sass/scss

@mtaman

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 did you find difficult while building the project? -- I learn that <picture> git line height from the parent - I had white space after <picture> and I fix it with add line-height: 0; to the parent tag.

Do you have any questions about best practices? it will be nice to know Your feedback.

Thank you

Community feedback

@rostyslav-nazarenko

Posted

Hi! Great result! 😀

Just a few suggestions/issues. I'm only studying so take my advice with a grant of salt.

  • component breaks from 700px to 900px, limit the width of the component or set media query to trigger earlier.
  • img is an inline element, most people use resets to make it display as block element that way there's no need in setting line-height to 0, especially when you need then to set it again on text elements
  • for centering elements we use flexbox but it doesn't work if the parent element has no height, so that is why we set min-height: 100vh; to the parent element. You don't need to repeat it on body element and on main element, use only on main. And remove min-width from both of them
  • Sass is a great tool but be aware of too much nesting. It creates problems with specificity in big projects. .prouduct_outer .prouduct_body .old_price {} is the same as .old_price{}.
1

@mtaman

Posted

@rostyslav-nazarenko Thank you ) I am happy with your feedback, 😊 and I am still learning) and I am self learning.

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