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

QR Code Component - HTML and CSS only.

Nick•30
@NickTalvy
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 it difficult to get my padding correct for the text. Also, I attempted MQ for tablet and desktop. I feel like I made it harder or more complicated then it needed to be.

I tried to keep accessibility in mind. Please tell me what I could do better, or any best practices I missed.

Code
Select a file

Please log in to post a comment

Log in with GitHub

Community feedback

  • Furkan Rehber•230
    @rehberbey
    Posted about 3 years ago

    Hello, I like your work. But when playing with my screen width, your typography is not correct (check 590px) and your image may shrink as the screen width grows. Also, I recommend removing the query "(max-width: 1900px)" from media queries.

    It would be much better if you fix them. ✨

    Marked as helpful
  • Sean H•90
    @Sean-LH
    Posted about 3 years ago

    Hey @NickTalvy,

    Awesome work on finishing the project, despite the challenges you had.

    In the future I would recommend starting with the mobile design first. I find it to be simpler to manage things like spacing when the viewport is smaller. And things get more complex as you increase the viewport. With that said, you may only have to do one MQ instead of two when you're expanding the viewport in the future.

    Marked as helpful
  • Kent O'Sullivan•1,870
    @12Kentos
    Posted about 3 years ago

    Hey @NickTalvy,

    Congrats on finishing this project, it looks good!

    I did notice however that your image isn't showing up. If you change the following code.

    <img src="/images/image-qr-code.png" alt="QR Code leading to FrontEnd Mentor">

    to

    <img src="images/image-qr-code.png" alt="QR Code leading to FrontEnd Mentor">

    Your image should start working, I simply removed the / in front of the path, so it's being directed correctly.

    Secondly I checked out your css, and noticed you selected elements directly several times like so.

    p { font-size: 0.9375rem; color: var(--grayishBlue); padding-inline: 1rem; padding-bottom: 1.8rem; }

    While this is fine for a smaller project like this, I would strongly advise against doing this in larger projects, as it will cause a LOT of headache. I would instead suggest selecting every element, with either a class or with a class and then the element directly. For instance instead of selecting the p directly you could do the following.

    .card p { font-size: 0.9375rem; color: var(--grayishBlue); padding-inline: 1rem; padding-bottom: 1.8rem; }

    This way only the p elements inside of the element with a class of card will be selected.

    Hope this helps, and keep up the great work!

    Marked as helpful
  • Okechukwu Victor chiedozie•580
    @covstar
    Posted about 3 years ago

    Check out my code for help.

    https://github.com/covstar/qr-code-component-solution

    Let me know if it was 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

Oops! 😬

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

Log in with GitHub