Design comparison
Solution retrospective
What is the best way to align the card above the center? I have used margin top to do it in the solution.
Community feedback
- @CyrusKabirPosted over 2 years ago
hello my dear friend ♥ for your question this link may help you :
1@Suhaan-BhandaryPosted over 2 years ago@CyrusKabir Thanks for the reply, but I was talking about the mobile design in which the card is not centered but is just above the center.
0 - @ahngePosted over 2 years ago
You can also use flexbox to do it. You just got to give the parent container 100vh.
1@Suhaan-BhandaryPosted over 2 years ago@ahnge Thanks for the reply, I have done the same thing for centering the card in the desktop view, but I was talking about the mobile design in which the card is not centered but is just above the center.
0 - @liezsmPosted over 2 years ago
Hi im no expert still in the learning process, but my suggestion is you can try setting your body's height to 100vh and then give it a display grid, place-items: center so the container will be automatically center and remove the 100vh from your container. I hope it helps. happy coding
1@Suhaan-BhandaryPosted over 2 years ago@liezsm Thanks for the reply I have used nearly the same approach for centering it in the desktop view, but I was talking about the mobile design in which the card is not centered but is just above the center.
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