Design comparison
Community feedback
- @satzzzzz07Posted about 2 years ago
Hey there, Great work on your solution! Design looks good. There are few suggestions:
- The qr component is not centered in the screen. Centering the Element - For Centering the element in the page you can wrap the element in a div and use flexbox more about flexbox.
Aside these, excellent work again and happy coding :) ๐
2 - @correlucasPosted about 2 years ago
๐พHello Greg, congratulations for your new solution!
๐ Great start and great first solution! Youโve done really good work here putting everything together, Iโve some suggestions you can consider applying to your code:
The approach you've used to center this card vertically is not the best way, because using margins you don't have much control over the component when it scales. My suggestion is that you do this alignment with
flexbox
using the body as a reference for the container.The first thing you need to do is to remove the margins used to align it, then apply
min-height: 100vh
to the body to make the child (the card/container) align to its size that now will be displaying 100% of the viewport height and then give its alignment withdisplay: flex
andalign-items: center
/justify-items: center
.1.REMOVE THE MARGIN TO MAKE THE PROPER ALIGNMENT:
@media (min-width: 375px) .container { /* margin: 8rem auto; */ width: 350px; }
2.USE MIN-HEIGHT AND FLEXBOX TO ALIGN:
body { min-height: 100vh; font-family: "Outfit", sans-serif; background-color: var(--lightgray); /* padding: 8rem; */ display: flex; align-items: center; justify-content: center; flex-direction: column; }
โ๏ธ I hope this helps you and happy coding!
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