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 using html & css

ify47 360

@ify47

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

Ecem Gokdogan 9,380

@ecemgo

Posted

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

  • If you want to make the card centered both horizontally and vertically, you'd better add flexbox and min-height: 100vh to the body
body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
}
  • If you use flexbox in the body, you don't need to use margin in the .container to center the card
  • If you use max-width, the card will be responsive and you can increase the width a bit
.container {
  /* width: 250px; */
  max-width: 280px;
  /* margin: auto; */
  /* margin-top: 100px; */
}
  • Finally, if you follow the steps above, you won't need to define media queries for this solution because the card will already be responsive and you can remove them to clean the code
/* 
@media (max-width: 375px) {
  .container {
    width: 80%;
  }
} 
*/

Hope I am helpful. :)

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