Stats preview card built using CSS Flexbox - Mac Learns

Solution retrospective
Hey how can I center the entire container vertically? I have centered it horizontally but cannot figure out vertically centering it.
Please log in to post a comment
Log in with GitHubCommunity feedback
- @DanK1368
Hey, good job on creating the site.
In order to get rid of HTML issue, you need to apply proper HTML5 semantics. Wrap your entire content in a main tag. You can also then apply the following to center everything:
main { display: grid; place-content: center; }
You also need to use an <H1> tag. Wrap your text in your .heading class in an <h1> tag, and it will solve the other issue. I also noticed that you do not wrap your other text within your div containers in any <p> tag. You should do that as well. It will assist the screen readers.
Hope this helps :)
- @darryncodes
Hi Mayank,
I'd opt for this:
display: flex; justify-content: center; align-items: center; min-height: 100vh;
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