@oppahero
Posted
Hey! :)
To center content, display:flex is a good option
With flex you can use the justify content and align elements properties.
To center on the x-axis, you can use justify-content:center
. And to center on the y axis, align-items: center
The card will be centered according to the height of its container, to do this you can indicate the height of the viewport to the body. Like this, height: 100vh
This way you could do without the margin-top and the margin-bottom that you have in the body
Happy coding!
Marked as helpful