Design comparison
SolutionDesign
Solution retrospective
What specific areas of your project would you like help with?
I would like to center the card horizontally couldn't find the way to do it
Community feedback
- @BasselfathyPosted 2 days ago
Goodjob Louis!
To center the box Horizontally and Vertically, give the
<body>
aheight: 100vh
andplace-items: center
.and you can remove the
margin:auto
from the box after that.0 - @hbeamaniiiPosted 2 days ago
On your .box element you can add "margin: auto" for the css and that should center the design horizontally. This should work if youre not using flexbox which you are.
This is what I can find for centering an element using flexbox. Hope this helps!
https://developer.mozilla.org/en-US/docs/Web/CSS/Layout_cookbook/Center_an_element
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