Skip to content
  • Unlock Pro
  • Log in with GitHub
Solution
Submitted about 1 year ago

QR Code Component

Denislav•130
@denislavdev
A solution to the QR code component challenge
View live sitePreview (opens in new tab)View codeCode (opens in new tab)

Solution retrospective


What are you most proud of, and what would you do differently next time?

This was my first real programming experience, so I'm really proud of what I made. I think I got it pretty close to the provided images. Next time, I’d probably focus more on optimizing my code and making it more efficient.

What challenges did you encounter, and how did you overcome them?

I had a bit of trouble centering things and making sure everything flowed properly, but I was able to fix that with some research and trial and error.

What specific areas of your project would you like help with?

I'd love to learn how to write better, more optimized code. Any feedback on improving the efficiency and readability of my code would be really appreciated.

Code
Couldn’t fetch repository

Please log in to post a comment

Log in with GitHub

Community feedback

  • Gwenaël Magnenat•1,540
    @gmagnenat
    Posted about 1 year ago

    Hi, congrats on completing the challenge ! Your solution looks great and close to the design. However there are some issues you should check and fix before moving to other challenges. I hope this list will help you improve this solution and your future ones.

    Does the solution include semantic HTML?

    • a <main> landmark is missing. You should always add one. The main element represents the main content of the body of a document or application. -w3c
    • instead of just indicating a QR Code in the alt attribute you can also indicate where this QR Code will lead to.

    Is it accessible, and what improvements could be made?

    • Currently the layout is breaking if the user is changing the default browser font-size.
    • You should set a max-width in rem on the card. Remove the fixed width in pixel.
    • You need to remove the height you have set in pixel. Let the card scale with its content. If the font size is increased having a fixed height will make the text overflow out of the card.
    • Don't use pixels for your font size. it's the same issue as above. Using pixel force the sizes to stay at that value. It will not scale and not respect user preferences. Why font-size must NEVER be in pixels
    • Many user update these settings to increase the size of the text on websites so its something to take in consideration and to understand.

    Does the layout look good on a range of screen sizes? yes

    Is the code well-structured, readable, and reusable?

    • You should add a modern css reset at the beginning of your stylesheet to have consistency over browser default settings. Check Josh Comeau or Andy Bell they both are great.
    • try to use low specificity first in your css before increasing only if necessary. You can add classes on your different elements to target them directly with a specificity of 10. Try not to style html element directly other then resets or if you are sure its a global style you want to apply on the whole website. It will improve the readability and maintainability of your code.
    /** examples **/
    [x] .card img <--- specificity of 11
    [✓] .card__image <--- specificity of 10
    

    Does the solution differ considerably from the design?

    • it looks close to the original. You can reduce the text width using ch unit if you want to have it on one extra line. the text in your solution looks wider.

    I hope you find these comments helpful. This challenge seems easy at first but it's the perfect place to fix some common issues before having more complex solutions to debug.

    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

Stay up to datewith new challenges, featured solutions, selected articles, and our latest news

Frontend Mentor

  • Unlock Pro
  • Contact us
  • FAQs
  • Become a partner

Explore

  • Learning paths
  • Challenges
  • Solutions
  • Articles

Community

  • Discord
  • Guidelines

For companies

  • Hire developers
  • Train developers
© Frontend Mentor 2019 - 2025
  • Terms
  • Cookie Policy
  • Privacy Policy
  • License

Oops! 😬

You need to be logged in before you can do that.

Log in with GitHub

Oops! 😬

You need to be logged in before you can do that.

Log in with GitHub

How does the accessibility report work?

When a solution is submitted, we use axe-core to run an automated audit of your code.

This picks out common accessibility issues like not using semantic HTML and not having proper heading hierarchies, among others.

This automated audit is fairly surface level, so we encourage to you review the project and code in more detail with accessibility best practices in mind.

How does the CSS report work?

When a solution is submitted, we use stylelint to run an automated check on the CSS code.

We've added some of our own linting rules based on recommended best practices. These rules are prefixed with frontend-mentor/ which you'll see at the top of each issue in the report.

The report will audit all CSS, SCSS and Less files in your repository.

How does the HTML validation report work?

When a solution is submitted, we use html-validate to run an automated check on the HTML code.

The report picks out common HTML issues such as not using headings within section elements and incorrect nesting of elements, among others.

Note that the report can pick up “invalid” attributes, which some frameworks automatically add to the HTML. These attributes are crucial for how the frameworks function, although they’re technically not valid HTML. As such, some projects can show up with many HTML validation errors, which are benign and are a necessary part of the framework.

How does the JavaScript validation report work?

When a solution is submitted, we use eslint to run an automated check on the JavaScript code.

The report picks out common JavaScript issues such as not using semicolons and using var instead of let or const, among others.

The report will audit all JS and JSX files in your repository. We currently do not support Typescript or other frontend frameworks.

Frontend Mentor for Teams

Frontend Mentor for Teams helps companies and schools onboard and train developers through project-based learning. Our industry-standard projects give developers hands-on experience tackling real coding problems, helping them master their craft.

If you work in a company or are a student in a coding school, feel free to share Frontend Mentor for Teams with your manager or instructor, as they may use it to help with your coding education.

Learn more

Oops! 😬

You need to be logged in before you can do that.

Log in with GitHub