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

Normal internal CSS with media query for margin

Atul kumar•200
@AtulKumar0001
A solution to the QR code component challenge
View live sitePreview (opens in new tab)View codeCode (opens in new tab)

Solution retrospective


How can I make it better? I would appreciate the tips.

Code
Select a file

Please log in to post a comment

Log in with GitHub

Community feedback

  • Vanza Setia•27,715
    @vanzasetia
    Posted almost 3 years ago

    Hello there! 👋

    Congratulations on completing your first Frontend Mentor challenge! 🎉

    Here are some recommendations for improvements.

    • I recommend moving all the styling to a separate CSS file. It's not a big deal for this challenge however, it's best to practice this so that you start having a habit of doing this. 🙂
    • I suggest removing the media query by finding an ideal value for the margin of the container. Maybe around 1.5em would be good for both desktop and mobile layout.
    • The QR code is an important image for this challenge so it needs an alternative text. Without alternative text, the image will not be pronounced by screenreaders.

    That's it! I hope you find this useful! 🙂

    Marked as helpful
  • P
    Natasha Pierre-Louis•280
    @natashapl
    Posted almost 3 years ago

    Hi Atul! I ditto everything that Assurance said. I'd also suggest looking into the main tag and some other HTML 5 semantic tags. Here's an article that gives a good overview:

    HTML5 Semantic Tags: What They Are and How to Use Them

    Marked as helpful
  • Assurance Chioma Ikogwe•410
    @Aik-202
    Posted almost 3 years ago

    Hi Atul, this is pixel perfect!!!! 😍😍😍. But I have some suggestions that can help you with your accessibility issues.

    1. You can change that div with class big container to main, as your code must have one main tag or you can add this to big container role = 'main'. Then the big container will be treated as main

    2. Change the h2 tag to h1, you can give it any font size in your css.

    3. Attach aria roles to each of your divs. I think the aria role to be used for the div with class container is group i.e role = 'group'. Click on this link to know more about aria roles

    Hope this helps.

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