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

Beginner-QR-Code-challenge-using-basic-HTML-and-CSS

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

Solution retrospective


Lots of thanks to everyone reviewing or checking my work and a big thumbs up for the community.

Code
Select a file

Please log in to post a comment

Log in with GitHub

Community feedback

  • Gr3g0ry99•120
    @Gr3g0ry99
    Posted over 2 years ago

    Hey buddy! So to center the box, if you remove all the margins you have set to the square class which will remove the scrollbar and add the following to the body class: min-height: 100vh; display: flex; justify-content: center; align-items: center;

    This should center the box! Let me know if this helps :)

    Marked as helpful
  • Angela Moore•170
    @Cyber-Chic
    Posted over 2 years ago

    Wonderful job completing your first challenge! 😊

    In addition to the other feedback you've received for this challenge, I have a few more recommendations:

    • There are games you can play to learn how to center content. I suggest trying Flexbox Zombies, Froggy Flexbox and Grid Garden. All 3 of the games are free.

    • Change your background color. You used a slightly different color. To do this I would change your code from:

    background-color: #c4e4e9;
    

    to

    background-color: hsl(218, 44%, 22%);
    
    • Add a <h1> element to your code. All sites should include a minimum of one <h1> element to indicate the the most important (or highest-level) heading on a page.

    • Add a <main> tag around the main content on your webpage. All web pages should include one <main> tag. This is a semantic HTML element that defines the main content on a page such as primary sections, text, articles, etc.

    Example:

    <main>
      <div class='container'>
        <h1>Main heading text</h1>
        <p>paragraph text</p>
      </div>
    </main>
    

    I hope this is helpful! Great work & Happy Coding!

    -Angie

    Marked as helpful
  • Durban86•320
    @Durban86
    Posted over 2 years ago

    Reading up on Flexbox will help you tons. Read this article and centering things will be a breeze. CSS Tricks: A Complete Guide to Flexbox

    Not everyone is going to have the same screen size, so hard margins won't center it for everyone.

    Also read up on padding and margin shorthand. It'll save you time instead of having to type out "margin-left, margin-right, margin-top" each time.

    Here is my css for reference

    Well done, keep at it!

    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.

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