QR Code component with CSS flexbox

Solution retrospective
Is there a better way to center the component? I used flexbox and set the page height to 98vh (I assume this isn't best practice).
Please log in to post a comment
Log in with GitHubCommunity feedback
- @ChamuMutezva
- the body is usually set to
min-height: 100vh
, I would go on and say that should be the best practice. - the image should have an alt value, it seems to me to carry a message. The message could be something like alt="QR code for Frontend mentor"
- landmark elements are one of the building blocks of a website, this challenge should at least have the
main
element. - for font sizes , it is recommended to use rems - using px values is not recommended. See the following article for further explanation. Why font-size must NEVER be in pixels
Happy coding
Marked as helpful - the body is usually set to
- @techyjc
vh
doesn’t take into account address bar in mobile browsers or non floating scroll bars. There is thedvh
option dynamic viewport height sizing but it lacks full browser support. The video below covers sizing containers and then use flexbox Justify-content and aligh-items to center the Flexbox content.This YT video might help… (https://youtu.be/-sF5KsEo6gM?si=vpMXHedXC4cfjVP7)
Marked as helpful
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