Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found

Submitted

QR-Card For mobile and Desktop Device

@webgeek2021

Desktop design screenshot for the QR code component coding challenge

This is a solution for...

  • HTML
  • CSS
1newbie
View challenge

Design comparison


SolutionDesign

Community feedback

@Kamlesh0007

Posted

Hello there 👋. Good job on completing the challenge !

In general, the solution is excellent. I have 2 small suggestions:

CSS 🎨:

Yes, there are other ways to center the card without using flex. One way is to use the grid layout: .container { display: grid; place-content: center; min-height: 100vh; } You can read more about centering in CSS here 📘. Note⚠️: Use min-height: 100vh instead of height. Setting the height to 100vh may result in the component being cut off on smaller screens, such as a mobile phone in landscape orientation. Note⚠️: You can also use position: relative, but using it in this type of component is a bad idea because it will clip it on mobile devices. CSS Reset 🔄:

Currently, you have a vertical scrollbar, which is due to the default margin that some browsers apply to the body element. To remove it and avoid problems in future challenges, I recommend starting to use a CSS reset. A CSS reset is a set of CSS rules that are applied to a webpage in order to remove the default styling of different browsers. CSS resets that are widely used: "My Custom CSS Reset" by JoshWComeau Reset CSS I hope you find it useful! 😄 Above all, the solution you submitted is great!

Happy coding!

0

@MohmedElshaarawy

Posted

Hi, Harshang Makwana Good job on completing the challenge!

I have some suggestions about your code that might interest you.

HTML

Use the <main> tag to wrap up all the main content of the page instead of the <div> tag. With this semantic element, you can improve the accessibility of your page. Use the <footer> tag to wrap the footer of the page instead of the <div class="attribution">. The <footer> element contains information about the author of the page, the copyright, and other legal information. Since this component involves scanning the QR code, the image is not a decoration, so it must have an alt attribute. The alt attribute should explain its purpose. e.g. QR code to frontendmentor.io CSS

Instead of using pixels in font size, use relative units like em or rem. The font size in absolute units like pixels does not scale with the user's browser settings. This can cause accessibility issues for users who have set their browser to use a larger font size. You can read more about this here. Use min-height: 100vh instead of height: 100vh. The height property will not work if the content of the page grows beyond the height of the viewport. I hope you find it useful!

Happy coding❤️

0

Please log in to post a comment

Log in with GitHub
Discord logo

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