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

@wetas2020

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

hitmorecode 6,230

@hitmorecode

Posted

If you remove margin: auto and margin-top: 1.5rem, the card will be placed in the middle of the page, because you are already using flexbox on the body, that in combination with min-heigh: 100vh is going to place the middle.

Your card is not responsive, you can do this by using flex-direction: column;.

main {
max-width: 500px;
background-color: var(--White);
display: flex; /* Change grid to flex */
/* flex-wrap: wrap; Enable wrapping for responsive layout */
justify-content: center; /* Horizontally center the content */
/* gap: 2rem; Add a gap between .product and .description */
box-shadow: 0 0.5rem 2rem 0 rgba(0, 0, 0, 0.1);
/*     margin: auto; */
/*     margin-top: 1.5rem; */
border-radius: 10px;
overflow: hidden;
}

Marked as helpful

1

@wetas2020

Posted

@hitmorecode I will try it, thank you for your remark

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