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

flexbox border-radius

AbdouAI 350

@AbdouAI

Desktop design screenshot for the Stats preview card component coding challenge

This is a solution for...

  • HTML
  • CSS
1newbie
View challenge

Design comparison


SolutionDesign

Solution retrospective


I had trouble centering the card div with flexbox so i did it manually with margins

Community feedback

Lucas 👾 104,420

@correlucas

Posted

👾Hello @AbdouAI, Congratulations on completing this challenge!

I've just opened your live site and I can say that you did a great job putting everything together! There's some tips to improve your solution:

Make the vertical alignment using flex properties and min-height. First of all put min-height: 100vh to the body to make the body display 100% of the viewport height (this makes the container align to the height size thats now 100% of the screen height) 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;
    font-family: "inter",sans-serif;
    font-size: 15px;
    margin: 0;
    background-color: hsl(233, 47%, 7%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
}

The way you’ve applied the purple color is fine, but if you want the exact color tone of color of the challenge designs, you need to use mix-blend-mode to make the color blend between the image and the background-color of the container. See the steps below to apply to the img or picture selector:

img {
mix-blend-mode: multiply;
opacity: 75%;}

✌️ I hope this helps you and happy coding!

Marked as helpful

0

AbdouAI 350

@AbdouAI

Posted

@correlucas Thank you so much this is really helpful

1
Hyron 5,870

@hyrongennike

Posted

Hi @AbdouAI,

Nice job on completing the challenge

If you want to position and element in the center you can use flexbox. Replace your body rule with the follwoing.

body {
    font-family: "inter",sans-serif;
    font-size: 15px;
    margin: 0;
    background-color: hsl(233, 47%, 7%);
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

and remove all the margin on the .card. Hope this is helpful.

Marked as helpful

0

AbdouAI 350

@AbdouAI

Posted

@hyrongennike Thanks ,I definitely prefer this method over using margins

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