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 card centering a div

@nicky1707

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 got css property overrinding problem ( css property crossed out ) it took me some time to understand it. What is the best practice to avoid it.

Community feedback

faizan 2,420

@afaiz-space

Posted

Hey @nicky1707, congratulation on completing the challenges.

  • remove margin-top: 10%; from the body element and add `min-height:100vh;, also add gap: 25px; in body element.
  • remove height: 400px; and align-items: center; from .container class.
  • remove margin-left: 30px; from content class.
  • also use *{ margin:0; padding:0; box-sizing: border-box; }
0
Kelvin 770

@githukelvin

Posted

Hello there,

you could just use margin:10rem auto;

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