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

QR static card using HTML CSS

Dust98β€’ 130

@Dust1100010

Desktop design screenshot for the QR code component coding challenge

This is a solution for...

  • HTML
  • CSS
1newbie
View challenge

Design comparison


SolutionDesign

Solution retrospective


Any idea to how could I improve my code?

Community feedback

Acme Gamersβ€’ 295

@AcmeGamers

Posted

Hey there πŸ‘‹,

Congratulations on completing the challenge πŸŽ‰! I really liked the way how you used width: min(30rem, 100%); to size the card's background πŸ˜€.

Also, here are some ways through which you can improve your code more:

Semantic HTML

Semantic HTML improves the SEO of the website by giving more meaning to your HTML code, and it is a good practice to wrap all of your frontend code inside a <main> tag. In your case, it will go as:

<main>
     <div class="contenedor">  ... </div>
     <p class="attribution">  ... </p>
</main>

Centering Elements

For centring elements on the screen, there are 3 ways from which we can do so with ease, and for this one, I will go with flexbox. Now considering you have added the <main> tag into your code, we normally do this:

.main {
     min-height: 100vh; // Catches full screen-height and can expand when more content is added
     display: flex;     // Flexbox

     flex-direction: column;     // Aligns your elements vertically [ div and p tag ]
     align-items: center;        // Center Elements Horizontally
     justify-content: center;    // Center Elements Vertically
}

This way, you won't need to use margin: 12.5% auto; on the contenedor class, helping you to align other elements more properly. You can try adding each line at a time from the above CSS code to understand how the flexbox works.

Looking forward to seeing your amazing work in the future and hope this helps 😊

Marked as helpful

0

Dust98β€’ 130

@Dust1100010

Posted

@AcmeGamers wow thanks you so much! i appreciate ✌

1
Acme Gamersβ€’ 295

@AcmeGamers

Posted

@Dust1100010 You're welcome 😊, I'm glad it was helpful for you. Also made a small update, try using min-height (good CSS practice) instead of height only, that way it can expand whenever the content reaches more than the screen height.

Marked as helpful

1

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