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

Responsive QR Code component page

materialize-css, material-ui
Bheru Singh Panwar•20
@EAGLEARCHER
A solution to the QR code component challenge
View live sitePreview (opens in new tab)View codeCode (opens in new tab)

Solution retrospective


I found difficulties while giving height and width, like how do I know the exact height & width of the box. I just did experiments to look like same as the image. But with a few hit and try it happened. It was a good project for a beginner like me.

Code
Couldn’t fetch repository

Please log in to post a comment

Log in with GitHub

Community feedback

  • Phenics13•60
    @Phenics13
    Posted over 2 years ago

    Hi there! I want to give you some pieces of advice how to solve problems which I faced during this challenge too and level up your frontend skills.

    How to avoid Accessibility report warnings.

    Use semantic HTML tags to avoid warning "Document should have one main landmark". Just wrap your div with class "attribution" in main tag like so:

    <main>
      <div class="attribution">
      </div>
    </main>
    

    How to solve difficulties with height and width.

    Before implementing a challenge in a code you can try to copy the given design in Figma. Just open Figma, place the design image in it, change the opacity of the image to 50% and just create design blocks over the image. Doing so you will be able to know height and width of some basic design elements.

    I hope, my feedback was helpful 💪

    Let's improve our frontend skills together 🎉

    Marked as helpful
  • Agnik Bakshi•480
    @Agnik7
    Posted over 2 years ago

    Hi, Congratulations on completing this challenge. While looking at your site, and going through your code, I found some things, that I believe will be helpful for you.

    • The Challenge by <a href="https://www.frontendmentor.io?ref=challenge" target="_blank">Frontend Mentor</a>. part is supposed to be the footer. It would be better to keep it towards the end of the body and replace the respective div with the footer tag.
    <footer class="attribution">
        Challenge by <a href="https://www.frontendmentor.io?ref=challenge" target="_blank">Frontend Mentor</a>.
        Coded by <a href="#">Bheru Singh Panwar</a>.
      </footer>
    
    • Try using relative units like rem and em more than absolute units like px for better responsiveness of the page.
    • Center the card component using grid or flexbox. This will ensure that the component always stays at the center irrespective of the screen size.

    To center using flexbox

    body{
    min-height : 100vh;
    display : flex;
    justify-content : center;
    align-items : center;
    }
    

    To center using grid

    body{
    min-height : 100vh;
    display: grid;
    place-items : center;
    }
    
    • When reducing the screen-size, the card shrinks way more compared to its contents, thereby failing to be responsive as a whole. Replace the percentage value of the max-width in .card with a value in rem.
    .card{
    max-width: 20rem;
    ---rest of code inside .card---
    }
    
    • Use shorthand notations for defining different attributes like margin and padding. To learn more about CSS shorthands, click here

    Hope this feedback helps you improve as a developer. Please feel free to correct me in case I said anything wrong.

    Have a nice day!!

    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