Skip to content
  • Unlock Pro
  • Log in with GitHub
Solution
Submitted almost 3 years ago

QR-Code Challenge

P
John•20
@HeavyMetalCoffee
A solution to the QR code component challenge
View live sitePreview (opens in new tab)View codeCode (opens in new tab)

Solution retrospective


---This is an updated version to create a better layout experience using the suggestions from my peers.

First challenge on Frontend Mentor. Feedback welcome as I know there are multiple ways this project could have been done and probably much better.

Code
Select a file

Please log in to post a comment

Log in with GitHub

Community feedback

  • Vanza Setia•27,715
    @vanzasetia
    Posted almost 3 years ago

    Hi, John! 👋

    Congratulations on completing your first Frontend Mentor challenge! 🎉

    You've gotten some awesome feedback especially on solving the issues that have been reported. I have some feedback as well.

    • The alternative text of the QR code is not giving enough information. If you try a screenreader and then close your eyes, then the screenreader pronounces the image as "Frontend Mentor, image.". Then, what do you think the screenreader users would think about the image?
    • Remove all br elements from the paragraph. Let lines wrap where they need to. Screen readers will read out br elements. You can't accommodate every screen size, so it's rare you'll ever need to use them.
    • Remove width and height from the body. Never use 100vw on anything as it doesn't account for scrollbars when present. It may only ever introduce potential overflow/scroll bugs.

    That's it! I hope this helps. 😊

    Marked as helpful
  • Ahmed Bayoumi•6,700
    @Bayoumi-dev
    Posted almost 3 years ago

    Hey John, It looks good!... Here are some suggestions:

    • Document should have one main landmark, Contain the component with <main>.
    <main class="container">
       <div class="qr_code_card">
          //...
       </div>
    </main>
    
    • Page should contain a level-one heading, Change <p class="p1"> to <h1 class="heading"> You should always have one h1 per page of the document... in this challenge, you will use h1 just to avoid the accessibility issue that appears in the challenge report... but don't use h1 on small components <h1> should represent the main heading for the whole page, and for the best practice use only one <h1> per page.

    • You have used grid to center the component on the page, but you need to set the height of the container ---> min-height: 100vh; to center it at this height:

    .container {
       display: grid;
        justify-content: center;
        align-items: center;
        /* width: 1440px;        /* <---- Remove  */
        /* height: 800px;         /* <---- Remove  */
        min-height: 100vh;     /* <--- Add */
     }
    
    • Use REM for font size, It is a must for accessibility because px in some browsers doesn't resize when the browser settings are changed... See this article ---> CSS REM – What is REM in CSS?

    Hope this help!... Keep coding👍

    Marked as helpful
  • Vanessa Méndez•30
    @vanmendez
    Posted almost 3 years ago

    Good job!! 👏 I have a couple of observations, if you don't mind:

    • Use semantic tags instead of div's, for example the container can be a <main>
    • Each web page must have an <h1> tag; if you decide to add more <h?> make sure to follow the ascending order of these I am starting in web development, in the tutorials that I have seen they indicate that we must avoid these errors. 😉
    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
Frontend Mentor logo

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 1st-party linked stylesheets, and styles within <style> tags.

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.

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

Oops! 😬

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

Log in with GitHub