Skip to content
  • Unlock Pro
  • Log in with GitHub
Solution
Submitted about 2 years ago

QR code component

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

Solution retrospective


All feedback is welcome

Code
Select a file

Please log in to post a comment

Log in with GitHub

Community feedback

  • Jenna•230
    @NandiniCooppen
    Posted about 2 years ago

    Hello Ola135,

    Congrats on completing the QR- code challenge 👏

    Here are some improvements that I would like to suggest :

    Improve accessibility

    1. Alternative text

    Adding a meaningful description to the 'alt'.

    For example alt="QR code for Frontend Mentor website"

    2. Semantic structure

    Using the semantic HTML5 in your structure.To improve the document structure and in return improve its accessibility, consider using <header>, <main>, <article>, and <footer> elements where applicable.

    For example :

    <main>
    <article class="card-section">
    <div class="container">
    <div class="card">
    <img src="images/image-qr-code.png" alt="">
    <div class="text">
    <h2>Improve your front-end skills by building projects</h2>
    <p>Scan the QR code to visit Frontend Mentor and take your coding skills to the next level</p>
    </div>
    </div>
    </div>
    </article> 
    </main>
    

    It is also important to always have an h1 heading in a document before a h2 tag.

    Read more about accessibility here

    Read more about semantics here

    Read more about headings here

    Using CSS variables

    For example, using the style guide provided, you may create your CSS colors variables as follow :

    root {
    --white: hsl(0, 0%, 100%);
    --light-gray: hsl(212, 45%, 89%);
    }
    
    

    Read more about CSS custom properties here

    Centering using Flexbox

    You have already applied CSS flexbox to the body to center the card. To center both horizontally and vertically, just add justify-content: center;

    You may then remove the margin: 0 auto; from .container.

    body {
    font-family: 'Outfit', sans-serif;
    background-color: hsl(212, 45%, 89%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    }
    

    I hope these will be helpful to you 😉

    Good luck going forward and happy coding 🙂

    Marked as helpful
  • Alexander Bobykin•90
    @abobykin
    Posted about 2 years ago

    Hello Ola! You did it well. Good.

    Couple things coming to head to improve for you, cause I'm pretty sure that HTML validator is unhappy )))

    • Could you please add <main> Your main code }} </main>

    This wrapper is needed inside <body> here </body>

    ===

    • It's also needed (According to https://www.w3.org/WAI/tutorials/page-structure/headings/) one <h1></h1> tag with a main heading on a page

    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
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