QR Code Component using HTML5 Boilerplate & Normalize.css

Solution retrospective
Hi everyone. This is my first entry into this community, and I look forward to watching everyone grow together in skills.
I wasn't aiming for pixel-perfect on this project because it didn't seem to be necessary for something like this. But I'm wondering if it actually is an important aspect of these challenges. I feel like it gets the job done, anyway.
How far do you think we should go towards that end? I'd like to get some better perspective on this before I start the next one. Thanks a bunch.
Bill
Please log in to post a comment
Log in with GitHubCommunity feedback
- @Kamlesh0007
Hello there 👋. Congratulations on successfully completing the challenge! 🎉
I have other recommendations regarding your code that I believe will be of great interest to you. CSS 🎨:
Looks like the component has not been centered properly. So let me explain, How you can easily center the component without using margin or padding. We don't need to use margin and padding to center the component both horizontally & vertically. Because using margin or padding will not dynamical centers our component at all states To properly center the component in the page, you should use Flexbox or Grid layout. You can read more about centering in CSS here 📚. For this demonstration we use css Grid to center the component. body { min-height: 100vh; display: grid; place-items: center; }
Marked as helpful - @0xabdulkhaliq
Hello there 👋. Congratulations on successfully completing the challenge! 🎉
- I have other recommendations regarding your code that I believe will be of great interest to you.
COMPONENT MEASUREMENTS 📐:
- Use
min-height: 100vh
for.container
instead ofheight: 900px
. Setting theheight: 900px
may result in the component being cut off on smaller screens.
- For example; if we set
height: 900px
then thebody
will have900px
height no matter what. Even if the content spans more than100%
of viewport.
- But if we set
min-height: 100vh
then thebody
will start at100vh
, if the content pushes thebody
beyond100vh
it will continue growing. However if you have content that takes less than100vh
it will still take100vh
in space.
.
I hope you find this helpful 😄 Above all, the solution you submitted is great !
Happy coding!
Marked as helpful
Join 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