Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found

Submitted

HTML CSS

@AndresF-SanchezG

Desktop design screenshot for the QR code component coding challenge

This is a solution for...

  • HTML
  • CSS
1newbie
View challenge

Design comparison


SolutionDesign

Community feedback

Lucas 👾 104,420

@correlucas

Posted

👾Hello @AndresF-SanchezG, Congratulations on completing this challenge!

Great code and great solution! I’ve few suggestions for you that you can consider adding to your code:

1.Reduce your code by removing unnecessary elements. The HTML structure is working but you can reduce at least 20% of your code by cleaning the unnecessary elements, you start cleaning it by removing some unnecessary <div>. For this solution you wrap everything inside a single block of content using <div> or <main> (better option for accessibility) and put inside the whole content <img> / <h1> and <p>.

<body>
<main>
<img src="./images/image-qr-code.png" alt="QR Code Frontend Mentor" >
 <h1>Improve your front-end skills by building projects</h1>
<p>Scan the QR code to visit Frontend Mentor and take your coding skills to the next level</p>
</main>
</body>

2.Use units as `rem` or `em` instead of `px` to improve your performance by resizing fonts between different screens and devices. 

To save your time you can code your whole page using `px` and then in the end use a VsCode plugin called **px to rem** here's the link → [**https://marketplace.visualstudio.com/items?itemName=sainoba.px-to-rem**](https://marketplace.visualstudio.com/items?itemName=sainoba.px-to-rem)  to do the automatic conversion or use this website [https://pixelsconverter.com/px-to-rem](https://pixelsconverter.com/px-to-rem)

**✌️ I hope this helps you and happy coding!**
0

@VCarames

Posted

Hey @AndresF-SanchezG, some suggestions to improve you code:

  • Section Elements are being used incorrectly.

  • To give you HTML code structure, you want to set up your code in the following manner (only did parent containers):

  <body>
    <main>
      <article class="card-container”>
      </article>
    </main>
  </body>

The Main Element identifies the main content of the document.

While the Article Element will serve as the card’s container, because the card represents a complete, or self-contained, section of content that is, in principle, independently reusable.

More info:

https://web.dev/learn/html/headings-and-sections/

  • The Alt Tag description for the QR image needs to be improved upon. Its needs to tell screen reader users what it is and where it will take them to when they scan it.

  • You overcomplicated you CSS code, there is no need for same many lines of code for such a simple challenge.

I simplified you code:

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --white: hsl(0, 0%, 100%);
    --light-gray:hsl(212, 45%, 89%);
    --grayish-blue: hsl(220, 15%, 55%);
    --dark-blue: hsl(218, 44%, 22%);
}



body {
    min-height: 100vh;
    display: grid;
    place-content: center;
    font-family: 'Outfit', sans-serif;
    background-color: var(--light-gray);
 
}

.main-container {
    max-width: 318px;
    text-align: center;
    padding: 16px;
    border-radius: 10px;
    background: var(--white);
}



img {
    width: 100%;

    border-radius: 10px;
    overflow: hidden;
}



.text-card h1 {
    font-size: 22px;
    color: var(--dark-blue);
    margin-top: 15px;
    margin-bottom: 10px;
}

.text-card p {
    font-size: 16px;
    color: var(--grayish-blue);
}

Happy Coding! 👻🎃

0

Please log in to post a comment

Log in with GitHub
Discord logo

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