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
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'm having trouble with the positioning any help

Community feedback

Neeraj Vermaโ€ข 70

@neeraj-verma-20

Posted

๐Ÿ‘‹ ๐—›๐—ฒ๐—น๐—น๐—ผ ๐—ข๐—ก๐—ฌ๐—œ๐—ก๐—ฌ๐—˜๐—–๐—›๐—จ๐—ž๐—ช๐—จ ๐—๐—˜๐—ฆ๐—ฆ๐—œ๐—–๐—” ๐— ๐—”๐—Ÿ๐—œ๐—ญ๐—จ, ๐—ฐ๐—ผ๐—ป๐—ด๐—ฟ๐—ฎ๐˜๐˜‚๐—น๐—ฎ๐˜๐—ถ๐—ผ๐—ป๐˜€ ๐—ณ๐—ผ๐—ฟ ๐˜†๐—ผ๐˜‚๐—ฟ ๐—ป๐—ฒ๐˜„ ๐˜€๐—ผ๐—น๐˜‚๐˜๐—ถ๐—ผ๐—ป!

Your product card is really good done, there's not much to say about it, but if you want to improve it a little bit more, you give it a better alignment with flexbox see the code below:

body {
    background-color: hsl(30, 38%, 92%);
    min-width: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

๐Ÿ‘‹ I hope this helps you and happy coding!

0
Lucas ๐Ÿ‘พโ€ข 104,420

@correlucas

Posted

๐Ÿ‘พHello onyinyechukwu Jessica Malizu, congratulations for your new solution!

All you need to do to align the component is remove the margins and add flexbox.

Follow these steps, first remove the margins, then add to the body min-height: 100vh to make the body display 100% of the browser screen size and display: flex e flex-direction: column to align the child element (the container) vertically using the body as reference.

body {
    min-height: 100vh;
    background-color: hsl(30, 38%, 92%);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.container {
    /* margin: 50px 20%; */
}

๐Ÿ‘‹ I hope this helps you and happy coding!

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