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

Flexbox + breackpoint at 375px

CeB-old 50

@CeB-old

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 didn't have the figma file so I try to be close as possible from the screenshot. If you have one picture/screenshot but you don't have a figma file or something like this. How you can find the size of the police or the padding size, etc? If you have some tips for me, thank you.

Community feedback

@AntonioMereu

Posted

I use Microsoft Power Toys. It includes a tool called Screen Ruler, which is incredibly useful for measuring design images. Additionally it offers a wide range of other handy features, such as Color Picker, Text Grab and a lot more. My favourite tool since you can use it on any program, unlike chrome or other browsers where you have to install a bunch of extensions.

Marked as helpful

1
P
Jeuri Morel 1,405

@JeuriMorel

Posted

I have a few suggestions on how you can improve the solution and make it responsive. As it currently is it only looks good at large screen widths.

First thing I would do is add height: 100%; to both the html and body tags. This ensures that the site takes up the full height of the screen and gets rid of a lot of potential issues.

Second, an easier way to center the card is to add the following to the body:

    display: flex;
    align-items: center;
    justify-content: center;

and then remove the following from the section:

     margin: auto; 
     position: absolute; 
     top: 50%; 
     left: 50%; 
     transform: translate(-50%,-50%);

Replace width: 20%; with something like max-width: 375px;. On small screens the card is really narrow. Read up on how to use clamp() here. It's one way to handle responsiveness.

Marked as helpful

0

CeB-old 50

@CeB-old

Posted

@JeuriMorel I update with your tips, thank you. It seem more easy with the height than to use absolute postion and transform.

0
P
Jeuri Morel 1,405

@JeuriMorel

Posted

@CeB-old

You're welcome. It works on all screen sizes now.

0

@MaximilianoDanielGarcia

Posted

Hi @CeB-old!

I use a browser extension called Perfect Pixel. It's a very useful tool.

0

CeB-old 50

@CeB-old

Posted

@MaximilianoDanielGarcia Thank you for the tips, I will try this for the next challenge

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