Design comparison
Solution retrospective
Hello everyone,
Here is my solution for the " QR-code-component " challenge.
Any constructive comments are welcome.
Good coding !
Community feedback
- @correlucasPosted about 2 years ago
👾Hello again Misa, Congratulations on completing this challenge!
Nice solution and nice code! I can see that you paid a lot of attention to your code/design. If you don’t mind I’ve some tips for you:
1.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
.
body { min-height: 100vh; margin: 0; padding: 0; box-sizing: border-box; background-color: hsl(212, 45%, 89%); font-family: 'Outfit', sans-serif; display: grid; justify-items: center; align-items: center; } .container { /* margin-top: 100px; */ }
2.Use
<main>
instead of<div>
to wrap the card container, its better to use<mai>
in this case because you’re indicating that’s the main block of content of this page and also because<div>
doesn’t have any meaning, it's just a block element.3.Every page needs a main heading, the
<h1>
to show which is the most important heading. You need to increase the headings by one level, like h1, h2, h3 to show the titles hierarchy. Remember that you cannot have more than one h1 heading.✌️ I hope this helps you and happy coding!
Marked as helpful1@DervisevicMPosted about 2 years ago@correlucas Hello Lucas, Thanks for your suggestions, I just applied them to my work. 👍
1 - The first thing you need to do is to remove the margins used to align it, then apply
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