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

QR code using CSS

daniel•80
@retailescapeartist
A solution to the QR code component challenge
View live sitePreview (opens in new tab)View codeCode (opens in new tab)

Solution retrospective


I was unsure about how to size the items better. I got around most of it, but it was messy. I'm sure I'll get better with time

Code
Select a file

Please log in to post a comment

Log in with GitHub

Community feedback

  • C H A R A N 🎯•2,670
    @0xabdul
    Posted about 2 years ago

    Hi daniel | Dev | we'll congratulations on completing the QR code component this project you doing very well but some Accessibility reports occurred A Few Feedback for improve your code and clear the issue

    Solution 📌

    IN HTML 📂 :

    L A N D M A R K 🚀

    • The main landmark should be a top-level landmark. When a page contains nested document and/or application roles (e.g. typically through the use of iframe and frame elements), each document or application role may have one main landmark. If a page includes more than one main landmark, each should have a unique label.
    • To Clear the Accessibility reports use the Semantic elements Or non - Semantic elements
    • Note This Elements are don't sikp
    • semantic elements : <aside> , <artical> , <main>, <header> ,<section><footer>, <form> ect..
    • non- semantic elements : <div> , <span> ect ...
    • for easy way to clear the Accessibility reports using non semantic elements Ex :
    <body>
    <div class="container" role="main">
    // All html code goes here : 📃
    </div>
    </body>
    
    • Or
    • using semantic elements
    • Ex :
    <header>
    should be put heading or logo📸
    </header>
    <nav>
    //Links here
    </nav>
    <main>
    Main of the contents 📃
    </main>
    <footer>
    ©copy right  here📍
    </footer>
    

    HEADINGS ⚙️

    • The page must contain 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 reason Accessibility reports occurred Ex : <h1> must </h1> I Recommend you Know fully one level heading📚 Click here

    IN CSS 🎨 :

    Your QR card is not center aligning it shows top of the Web page 📃 so fix that

    Example :

    body {
    display:grid;
    place-items:center;
    margin:0;
    height:100vh;
    }
    

    I Hope it's useful for you and Happy Coding 🤩

  • Gem•120
    @ladyprogrammer
    Posted about 2 years ago

    There are several techniques to center content if you look around. The most recent ones are CSS Flexbox or Grid. Among those I searched online, these two are the ones that helped most.

    • [CSS Flexbox] (https://css-tricks.com/snippets/css/a-guide-to-flexbox/)
    • [CSS Grid] (https://css-tricks.com/snippets/css/complete-guide-grid/)

    I suggest learning CSS Flexbox first as it's easier to grasp before learning the CSS grid as flexbox is simpler.

  • visualdennis•8,375
    @visualdenniss
    Posted about 2 years ago

    Hello there,

    good work! You just need to center the card and import the font families. You can do that by using CSS GRID or CSS FLEXBOX like so:

    body { background-color: cadetblue; min-height: 100vh; display: grid; place-items: center; }

    For fonts, you can import is with @import, just add this to the top of your css file:

    @import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;700&display=swap');

    then you can use it like so:

    • font-family: 'Outfit', sans-serif;

    Hope you find my feedback 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 1st-party linked stylesheets, and styles within <style> tags.

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.

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