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

Plain html and css.

@Abhijeet-Bhushari

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


What are the best practices that I missed?

Is my way of centering a div a correct or optimal way?

Community feedback

@VCarames

Posted

Hey there! šŸ‘‹ Here are some suggestions to help improve your code:

Regarding your question about centering:

To properly center your content to your page, you will want to add the following to your body (this method uses CSS Grid):

body {
    min-height: 100vh;
    display: grid;
    place-content: center;
}

More Info: šŸ“š

Centering in CSS

  • One crucial element missing from your code, which should always be included, whether it's a component or a full website, is the main element. Its presence is essential for maintaining good semantics and accessibility, as it assists in identifying the primary content of your site.
  • The alt tag for the QR image requires improvement, as its current content doesn't convey where it leads when scanned. It should provide a clear indication of the destination for users who scan it.
  • "Improve your front-end skills by building projects" is a heading, so it should be wrapped in a heading element.
  • Currently, your content is not responsive and this is due to your use of width on the container of the card. You instead want to use max-width.

If you have any questions or need further clarification, feel free to reach out to me.

Happy Coding! šŸ‘¾

Marked as helpful

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