Design comparison
SolutionDesign
Solution retrospective
I found it difficult to make the content in the middle of the page. Are there any way to make it easier and more understandable ? Thank you so much
Community feedback
- @ParvizAzerogluPosted about 1 year ago
Generally, I use flex to center items within a container. This means that I write the following code in CSS:
body { display: flex; align-items: center; justify-content: center; height: 100vh; }
However, you can also use
margin: auto;
in the body. Such as :body { margin: auto; height: 100vh; }
But remember that this code is only useful for centering a single item; you can't use it for more than one item.
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