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

GrdevPro 20

@GrdevPro

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


I did have some difficulties on align text under QRcode

Community feedback

Hassia Issah 50,670

@Hassiai

Posted

Ther is no need for <div class="bg_blue"> <div class="bg_white"> in the html and their styling in the css.

Give the body a background-color of hsl(212, 45%, 89%);.

There is no need to style .qr-code

For a responsive content,

  • Give the main a fixed max-width value, a padding value for all the sides max-width: 320px which is 20rem/em padding:16px which is 1rem/em, a background-color of white and a border-radius value, the rest are not needed
  • Give the img a max-width of 100% and a border-radius value, the rest are not needed.

To center the main on the page using flexbox or grid,

  • USING FLEXBOX: add min-height:100vh; display: flex; align-items: center: justify-content: center; to the body
body{
min-height: 100vh;
display: flex;
align-items: center;
justify-content: center;
}
  • USING GRID: add min-height:100vh; display: grid place-items: center to the body
body{
min-height: 100vh;
display: grid;
place-items: center;
}

Use relative units like rem or em as unit for the padding, margin, width values and preferably rem for the font-size values, instead of using px which is an absolute unit. For more on CSS units Click here and here

Hope am helpful.

Well done for completing this challenge. HAPPY CODING

Marked as helpful

0
P

@rinster

Posted

Hi! Great job on this! The text alignment looks great. A couple of things:

It looks like the image wasn't uploaded to your host. Once that's uploaded, the image should show :)

A small adjustment to your css makes the QR centered on mobile and tablet:

div.bg_blue{
    display: flex;
    justify-content: center;
    align-items: center;
    background-color:  hsl(212, 45%, 89%);
    /* width: 1440px; */ 
    height: 100vh;  
    margin: 150px auto;
}

Marked as helpful

0
Steve 1,170

@peanutbutterjlly

Posted

Hey @GrdevPro 👋,

one suggestion I have is for your div with a class of bg_blue, I'd put a width: 100vw; and height: 100vh; and margin: 0; - that should help make your background cover the whole page and center things nicely.

not sure why your image isn't showing up, it looks like its pointed to the right place 🤔

good job on your submission, keep up the good work!

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