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

Semantic HTML5, markup CSS custom properties and Mobile-first workflow

accessibility, bem
Emmanuel Omoogun•40
@Abiodun1Omoogun
A solution to the QR code component challenge
View live sitePreview (opens in new tab)View codeCode (opens in new tab)

Solution retrospective


One thing I found difficult in this challenge is media queries

Any feedback on how I can improve?

Code
Select a file

Please log in to post a comment

Log in with GitHub

Community feedback

  • Lucas 👾•104,160
    @correlucas
    Posted almost 3 years ago

    👾Hi @Abiodun1Omoogun, congratulations on your first solution!👋 Welcome to the Frontend Mentor Coding Community!

    Great solution and a great start! From what I saw you’re on the right track. I’ve few suggestions for you that you can consider adding to your code:

    • Add the correct size to avoid the container growing more than it should. In this case the QR CODE component size is max-width: 320px.
    • You’ve used px as the unit for sizes but the problem with pixels is that it is not optimized for multiple devices and screens. So a good fit is to use rem or em that have better performance and make your site more accessible between different screen sizes and devices. REM and EM does not just apply to font size, but to all sizes as well.
    • Use a CSS reset to avoid all the problems you can have with the default CSS setup, removing all margins, and making the images easier to work, see the article below where you can copy and paste this CSS code cheatsheet: https://piccalil.li/blog/a-modern-css-reset/
    • Reduce your code putting all content inside only one div.

    ✌️ I hope this helps you and happy coding!

    Marked as helpful
  • Kawsar Ahmed Fahad•2,660
    @faha1999
    Posted almost 3 years ago

    Hello, Emmanuel Omoogun Congratulations on finishing this project. It's lovely and great on the whole! Just a little tip:

    • add the below code to the body. It will center everything
    body {
         justify-content: center;
        align-items: center;
        display: flex;
        min-height: 100vh;
        flex-direction: column;
    }
    
    • add the below code to the main. It will center everything
    main{
        max-width: 340px;
     padding: 1.2rem;
    }
    
     h1 {
          font-size: 1.4rem;
          font-weight: bold;
          margin-bottom: 1rem;
        }
    
    p{
     font-size: 1rem;
    }
    
    • **Remove all transform, width, height from main.

    • No media query is required for this project.

    • This is my solution for this project live, repo

    I hope it will work. Happy coding.

    Marked as helpful
  • Joseph Fola•590
    @Fola-Joe
    Posted almost 3 years ago

    Well done on your first project on Frontend Mentor 🎉🎊 Just make a little adjustment to your css code. First, set your main width to a definite value rather than using percentage

    main {
       max-width: 370px;
    }
    

    You could as well not give the 'main' selector a 'height' property, but edit your body height to min-height and not max-height. I hope this helps! Happy coding!

    Marked as helpful
  • Nelson Nzewi•270
    @nzewi
    Posted almost 3 years ago

    Congrats on completing your first challenge Emmanuel

    You have a great solution there

    Here are my suggestions for you:

    1.You don't need media queries to make this challenge responsive. If you follow responsive design principles, it would be enough. I would recommend this [course] (https://courses.kevinpowell.co/view/courses/conquering-responsive-layouts/)

    2.Using relative units like rem and em instead of px would make your site more responsive. Learn about them and use them in your next project.

    3.You can center your card by doing this

    main {
       display: flex;
       justify-content: center;
       align-items: center;
    }
    

    4.I noticed you made your h1 and p flex containers, wrapped your image in a <section> tag and used a <br> tag in your <h1>. Doing these are not necessary as you can achieve your solution without them.

    I hope this helps

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

Oops! 😬

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

Log in with GitHub