Design comparison
Solution retrospective
I had trouble centering the card div with flexbox so i did it manually with margins
Community feedback
- @correlucasPosted about 2 years ago
👾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 andmin-height
. First of all putmin-height: 100vh
to thebody
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 anddisplay: flex
eflex-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 theimg
orpicture
selector:img { mix-blend-mode: multiply; opacity: 75%;}
✌️ I hope this helps you and happy coding!
Marked as helpful0 - @hyrongennikePosted about 2 years ago
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 helpful0@AbdouAIPosted about 2 years ago@hyrongennike Thanks ,I definitely prefer this method over using margins
0
Please log in to post a comment
Log in with GitHubJoin 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