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

QR code using HTML CSS

Etti Taiwo•30
@t33boi
A solution to the QR code component challenge
View live sitePreview (opens in new tab)View codeCode (opens in new tab)
Code
Select a file

Please log in to post a comment

Log in with GitHub

Community feedback

  • Badsha Hossain•20
    @badshab454
    Posted over 2 years ago

    Congrats.

  • Abdul Khaliq 🚀•72,380
    @0xabdulkhaliq
    Posted over 2 years ago

    Hello there 👋. Congratulations on successfully completing the challenge! 🎉

    • I have other recommendations regarding your code that I believe will be of great interest to you.

    HTML 🏷️:

    • This solution generates accessibility error reports, "All page content should be contained by landmarks" is due to non-semantic markup, which causes lacking of landmark for a webpage

    • So fix it by replacing the <div class="card-body"> element with the semantic element <main> in your index.html file to improve accessibility and organization of your page.

    • What is meant by landmark ?, They used to define major sections of your page instead of relying on generic elements like <div> or <span>. They are use to provide a more precise detail of the structure of our webpage to the browser or screen readers

    • For example:
      • The <main> element should include all content directly related to the page's main idea, so there should only be one per page
      • The <footer> typically contains information about the author of the section, copyright data or links to related documents.

    HEADINGS ⚠️:


    • This solution has also generated accessibility error report due to lack of level-one heading <h1>

    • Every site must want at least one h1 element identifying and describing the main content of the page.

    • An h1 heading provides an important navigation point for users of assistive technologies, allowing them to easily find the main content of the page.

    • So we want to add a level-one heading to improve accessibility by reading aloud the heading by screen readers, you can achieve this by adding a sr-only class to hide it from visual users (it will be useful for visually impaired users).

    .

    I hope you find this helpful 😄 Above all, the solution you submitted is great !

    Happy coding!

  • Hassia Issah•50,390
    @Hassiai
    Posted over 2 years ago

    Replace <div class="card-body"> with the main tag and <h2> with <h1> to fix the accessibility issues. click here for more on web-accessibility and semantic html

    Give thhe alt attribute in the img a value. The value of the alt attribute is the description of the image. For decorative images like icons, there is no need to give it an alt value, for more on alt attribute Click here.

    Every html must have <h1> to make it accessible. Always begin the heading of the html with <h1> tag wrap the sub-heading of <h1> in <h2> tag, wrap the sub-heading of <h2> in <h3> this continues until <h6>, never skip a level of a heading.

    Give .text a margin value for all the sides, text-align: center and a font-size of 15px which is 0.9375rem, this will be the font-size of both p and h1. Give p a margin-top or h1 a margin-bottom value for the space between the text.

    For a responsive content,

    • Replace thw width in .card-body with max-width value and the height with a padding value for all the sides padding:16px which is 1rem/em
    • Give the img a max-width of 100% and a border-radius value, the rest are not needed.

    Use relative units like rem or em as unit for the padding, margin, width values and preferably rem for the font-size values, instead of using px which is an absolute unit. For more on CSS units Click here

    Hope am helpful.

    Well done for completing this challenge. HAPPY CODING

  • khushboo khatwani•1,070
    @khushi0909
    Posted over 2 years ago

    I also just started the journey and submitted the challenge few hours before and What i have learnt are as follows-

    1)use min-height in body as 100 vh instead of height -you can see explanation by @abdul Khalid in my solution is as follows I have some recommendations regarding your question "what happens by putting min-height?" that I believe will be of great interest to you. MIN-HEIGHT 📐:

    We want to use min-height: 100vh for body instead of height: 100vh. Because setting the height: 100vh may result in the component being cut off on smaller screens, such as a mobile phone in landscape orientation. For example; if we set height: 100vh then the body will have 100vh height no matter what. Even if the content spans more than 100vh. But if we set min-height: 100vh then the body will start at 100vh, if the content pushes the body beyond 100vh it will continue growing. However if you have content that takes less than 100vh it will still take 100vh in space. !

    2)use <footer> for the following line- Challenge by <a href="https://www.frontendmentor.io?ref=challenge" target="_blank">Frontend Mentor</a>. Coded by <a href="https://github.com/ddddddd" target="_blank">dddddd</a>. and you can also reach more information about it from Using Semantic HTML Tags Correctly

    3)Also there needs to be on h1 in the index.html for seo purpose it helps ,so including that instead of jumping directly to h2 may help https://www.semrush.com/blog/h1-tag/ 4) You need to replace <div class="container"> with the <main class="container"> tag. You'd better use Semantic HTML, and you can also reach more information about it from Using Semantic HTML Tags Correctly.

    4)always mention alt ="description of image ",you can read about it ,why its necessary for accessibility

    Everything else seems great keep going ...All the Best

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