Design comparison
Solution retrospective
I have some problems with centering elements on screen. I know how I can center an element with flexbox but in small screens, I see some weird results. Thanks!
Community feedback
- @NimaFrEeMaNPosted almost 3 years ago
Hi, you can center your elements by giving your element these properties
{ position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); }
Marked as helpful1 - Account deleted
you can center the element by giving the body these properties
display:flex; justify-content:center; align-items:center; height:100vh;
don't forget to mark this as helpful !
Marked as helpful1@moheb2000Posted almost 3 years ago@Old1337 Thanks! I used this method before and in small screens my card became very small. I think for small screens I should use media queries anyway.
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