Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found

Submitted

QR_code component, relative positioning

@AaronNevalinz

Desktop design screenshot for the QR code component coding challenge

This is a solution for...

  • HTML
  • CSS
1newbie
View challenge

Design comparison


SolutionDesign

Solution retrospective


  • difficulty in centering the container harboring the QR-code image and the description

How do you best center a div in a div?

Community feedback

Thibaut 170

@ThibautMilville

Posted

Hello,

In this case, you should simply give your body a 100% height adapted to the user's screen (100vh), using flex and the align-items / justify-content properties so that your container is perfectly aligned in the center of the page.

body{ height: 100vh ; display : flex ; justify-content : center ; align-items : center ; }

Good luck and happy coding!

1

Please log in to post a comment

Log in with GitHub
Discord logo

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