Responsive QR Code Component using Flexbox

Solution retrospective
-
I got really confused with deciding appropriate font sizes and had to refer to other solutions and try different sizes. Is there a better way to deal with it while we are cloning a project?
-
Although I have tried to make the project as responsive as I can. I did not understand or use Media Queries for Mobile's first approach. How can I do that?
-
I'd love to know your views on HTML Semantics and element naming in my code.
Please log in to post a comment
Log in with GitHubCommunity feedback
- @denielden
Hello Aviral, You have done a good work! 😁
- Font sizes are eye to eye unless you are given the size to insert in the code.
- The approach to Media Queries is very easy: you only use them when the design breaks at a certain screen resolution and you scale the code of the same classes to that resolution read here
Some little tips to improve your code:
- remove all unnecessary code, the less you write the better as well as being clearer: for example the
div
container of qr image - remove all
margin
frombox
class - use flexbox to the body to center the card. Read here -> best flex guide
- use
min-height: 100vh
to body instead ofheight
, otherwise the content is cut off when the browser height is less than the content
Keep learning how to code with your amazing solutions to challenges.
Hope this help 😉 and Happy coding!
Marked as helpful - @grace-snow
That img is the most important content on the page, why have you aria hidden it?!
Don't use the
b
element. Set the font weight you want in cssBody should never have a limited height. Use min height instead.
Beware using % for border radius. It will have horrible results if used on anything that's not square
Marked as helpful - @Maacaa0
Hello,
To answer your first question. I use browser extension called perfectpixel. Which let you put the design image overlay over the page you are creating. It helps you see how accurate you are with your project.
Hope I helped 😁
Good work, keep it up.
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