Design comparison
Solution retrospective
i struggle with the align-item center .i could'nt possition it to center, but it is responsive to mobile design
Community feedback
- @kkmarlitosPosted over 1 year ago
hey man, the best way to center something is using 'display:grid', try to study a little about it, it's complex but not that difficult, in this case I think if you say that your 'body' is display:grid and use ' height:100vh', 'align-items:center', 'justify-content:center' can solve it, if it doesn't solve it use 'position relative' in the body and relative in the div, and try to align with top and left. I'm trying to help but I'm still studying about it :D, I know that one of the two will work.
0 - @DebestaPosted over 1 year ago
If you want to position element in the middle u can use basic argument like position:
in your solution
body{ position: relative; } .qr{ 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