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 CSS and Flexbox

Azeezat 10

@azeezatb-o

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


Kindly look through my code and tell me if i implemented the flexbox right. I am completely new to the whole responsive web design and I would like to improve my web development skills, so I would really appreciate pointers from people that are more experienced. Thanks

Community feedback

Ecem Gokdogan 9,380

@ecemgo

Posted

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

  • In order to center the card, you can add flexbox and min-height: 100vh to the body
body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
}
  • After adding them, you don't need to use margin in the .container to center the card so you can remove it
.container {
    /* margin: 100px 500px; */
} 
  • Finally, you haven't used <main> tag in html file, so you can remove it from CSS file:
/* 
main {
    background: hsl(212, 45%, 89%);
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between; 
 }
 */

Hope I am helpful. :)

0

@kaesle

Posted

Azeezat,

Your solution looks great! And it does respond to width changes. There is a bit of a problem with responsiveness to height, though.

Your div.container has height 60%, while the contents don't scale the same way with height. A better solution might be to remove the "height" property, allowing the box to size to the content, and use padding to keep the negative space as the design requires.

I'm not a professional myself, so keep your eyes out for comments from others.

Matt

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