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

responsive grid box using css

Quantom 30

@Quantom223

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


couldn't positioning the whole container to the center, button issues on mobile view . Please tell me how I can improve.

Community feedback

Hyron 5,870

@hyrongennike

Posted

Hi @Quantom223,

Good job on your first attempt

To center the card in the middle of the page you can make the following changes to you body rule in the media query.

@media screen and (min-width: 601px) {
body {
    width: 600px;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}
}

and the button is missing padding on mobile because you're only adding the padding in the min-width:601px media. you can add the padding padding: 0.8rem; on the .addToCart class outside the media query and both mobile and desktop will have padding.

Hope this is helpful.

Marked as helpful

0
Quantom 30

@Quantom223

Posted

Thank you sir, it was helpful. the card centered to the middle, And the button are fixed too

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