Design comparison
SolutionDesign
Solution retrospective
how to center my entire div to the body of the webpage? i tried using display: flex property in body to center my div but it didnt work
Community feedback
- @sophiakoulenPosted over 2 years ago
My guess is the body isn't 100% of the viewport.
If you set a background-color to body, the background will take the whole viewport but the actual body won't necessarily.
Try using
height:100vh
on the body.0 - @Nithin-droidPosted over 2 years ago
Hi Deepak
Have you tried using translate(). Try using below CSS in .QR-code
position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
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