QR Code Component using HTML5 Boilerplate & Normalize.css
Design comparison
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
Community feedback
- @Kamlesh0007Posted over 1 year ago
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 helpful0@billccrPosted over 1 year ago@Kamlesh0007 Thanks very much for the feedback, Kamlesh. It's much appreciated.
I did use Flexbox for the layout, but have not yet tried the use of
vh
in sizing the component. I'll take another run with this in mind and see how it goes.Thanks!
0 - @0xabdulkhaliqPosted over 1 year ago
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 helpful0@billccrPosted over 1 year ago@0xAbdulKhalid Thank you very much, Abdul. I'm happy to get such a specific recommendation. I'll definitely look into this further.
vh
is not something I'm familiar with up to now.Thanks again!
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