Design comparison
Community feedback
- @correlucasPosted about 2 years ago
👾Hi @py-rod, congratulations on your first solution!
I’ve few suggestions for you that you can consider adding to your code:
Your solution its already good, something you can do to improve the card responsiveness is create a media query for the
stats section
and make each stat number stay in a different row aftermax-width: 350px
using a media query, here's the code for that:@media (max-width: 350px) { .card__container__stadi { border-top: 1px solid rgba(212, 212, 212, 0.726); padding: 20px 0; display: flex; justify-content: space-around; flex-direction: column; } }
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 make the body height size becomes 100% of the screen height, this way you make sure that whatever the situation the child element (the container) align the body withdisplay: flex
andalign-items: center
/justify-items: center
. If you're using the attribution you need to addflex-direction: column
to make the attribution stays under the QR Code component. See the code below:✌️ I hope this helps you and happy coding!
Marked as helpful1
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