Design comparison
Solution retrospective
I had trouble centering the div without affecting the format of the text and image, along with centering the div itself rather than being located on the top-left corner of the body. This was resolved by implementing a margin to the div.
Community feedback
- @MilleusPosted almost 2 years ago
π Hello! Congratulations on completing your first challenge.
Typically you'd want to add a
min-height: 100vh
to the body so that the minimum height stretches to match the viewport. After that we could use Flexbox or Grid to help with centering. E.g.body { display: flex; align-items: center; justify-content: center; }
or with grid
body { display: grid; place-items: center; }
I'd suggest reading up more about Flexbox and Grid. MDN website is a good source for learning. There are also Flex/Grid game websites to help with learning.
Other than the issues highlighted in the accessibility report, one other thing that could be improved is to change the
<div class="attribution"
to a <p> tag instead as it would be more semantically correct.Hope this helps and happy coding~
Marked as helpful1
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