QR code component using plain HTML and CSS

Please log in to post a comment
Log in with GitHubCommunity feedback
- @MelvinAguilar
Hello there 👋. Good job on completing the challenge !
I have some suggestions about your code that might interest you.
CSS 🎨:
- Instead of using pixels in font-size, use relative units like
em
orrem
. The font-size in absolute units like pixels does not scale with the user's browser settings. Resource 📘.
- You should use the
box-sizing: border-box
property to make thewidth
andheight
properties include the padding and border of the element. This will make it easier to calculate the size of an element. You can read more about this here 📘.
-
Use
min-height: 100vh
instead ofheight
. Setting the height to 100vh can cause your background to be cut off or the component itself to be cut off on small screens, such as a mobile phone in landscape orientation.Here is an image of how it would look on a mobile device (taking into account the scroll): screenshot-imgur 📸
- The
width: 100vw
property in themain
tag is not necessary. This can create a horizontal scrollbar on some devices.
I hope you find it useful! 😄 Above all, the solution you submitted is great!
Happy coding!
Marked as helpful - Instead of using pixels in font-size, use relative units like
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