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-code-component-main

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


My first solution left me quite unsatisfied so I took the tips left in the comments and used them to improve the solution. Any other suggestions are welcome.

Mi primera solución me dejo bastante insatisfecho asique tome los consejos que dejaron en los comentarios y los use para mejorar la solución. Cualquier otra sugerencia es bienvenida.

Community feedback

Panji 2,110

@pperdana

Posted

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

  • I have some additional recommendations for your code that I think you'll find interesting and valuable.

📌 Add <main> tag as semantic HTML in code

  • The <main> tag is a semantic HTML element that is used to define the main content of a web page.

  • The <main> tag should be used to wrap the primary content of a web page, such as the main article, section, or body of text.

for example code:

<main>
  <div class='container'>
    <h1>Article Title</h1>
    <p>Article content goes here...</p>
    .......................
  </div>
</main>

In the example above, the <main> tag is used to wrap the <div> tag, which contains the primary content of the web page. This tells both human readers and search engines that the content inside the <main> tag is the most important and relevant content on the page.

I hope you found this helpful!

Happy coding🤖

1
Ecem Gokdogan 9,380

@ecemgo

Posted

Some recommendations regarding your code that could be of interest to you.

  • In order to center the card correctly, you'd better add min-height: 100vh to the body
  • If you want, you can use the recommended color for the background:
body {
  min-height: 100vh;
  background-color: hsl(212, 45%, 89%);
}
  • After adding them, you need to remove margin and you don't need overflow and height:
  • You also need to fix the width:
.attribution {
  /* margin: 2.5rem; */
  /* background-color: #eee; */
  background: white;
  /* width: 25%; */
  max-width: 320px;   /* max-width makes the card responsive */
  /* height: 20%; */
  /* overflow: hidden; */
}
  • Finally, you'd better fix the img. For this, you can add width: 100%;, height: 100%; and display: block;
.attribution img {
  /* width: 200px; */
  width: 100%;
  /* height: 200px; */
  height: 100%;
  display: block;
}

Hope I am 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