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 Challenge Solution using Semantic html and flexbox.

P
Celie987 40

@Celie987

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

hitmorecode 6,230

@hitmorecode

Posted

You hard coded the position of the card. In this case the best way to do this, is by using flexbox. Apply flexbox to html

html {
font-family: var(--FONT-FAMILY);
background-color:  #D5E1EF;
text-align: center;
/* add these four lines to place the card in the middle of the page*/
display: flex;
justify-content: center;
align-items: center;
min-height: 100vh;
}

main {
width: 320px;
height: 497px;
border-radius: 20px;
box-shadow: 0px 25px 25px 0px rgba(0, 0, 0, 0.05);
background-color: var(--BACKGROUND-COLOR);
/* you don't need these lines, flexbox on html will do this */
/*     position:absolute; */
/*     top: 50%; */
/*     left: 50%; */
/*     transform: translate(-50%, -50%);    */
display: flex;
flex-direction: column;
justify-content: space-around;
align-items: center;
}

Marked as helpful

1

P
Celie987 40

@Celie987

Posted

@hitmorecode

Thanks for your advice. Il will try this.

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