@correlucas
Posted
👾Hello , congratulations on your first solution!👋 Welcome to the Frontend Mentor Coding Community!
Nice code and nice solution! You did a good job here putting everything together. I’ve some suggestions for you:
Your component is okay but it's missing the vertical alignment. The best way to do it is by using flexbox
. The first step is to add 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) aligns the body and then use the flex properties for alignment with display: flex
/ align-items: center;
/ justify-content: center;
. If you're using the attribution you need to add flex-direction: column
to make the attribution stays under the QR Code component. See the code below:
body {
min-height: 100vh;
background-color: hsl(212deg, 45%, 89%);
font-family: "Outfit", sans-serif;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
Add a margin of around margin: 20px
to avoid the card touching the screen edges while it scales down.
Use relative units as rem
or em
instead of px
to improve your performance by resizing fonts between different screens and devices. These units are better to make your website more accessible. REM does not just apply to font size, but to all sizes as well.
✌️ I hope this helps you and happy coding!
Marked as helpful