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-component

MisterSixzā€¢ 40

@MisterSixz

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


What are you most proud of, and what would you do differently next time?

I've learnt about positioning and image sizing, I'll try to use other different tools next time.

What challenges did you encounter, and how did you overcome them?

The positioning and sizing is very hard for me, so I did google so many times for helps.

What specific areas of your project would you like help with?

About CSS box model and positioning

Community feedback

Daniel šŸ›øā€¢ 44,230

@danielmrz-dev

Posted

Hello there!

Congrats on completing the challenge! āœ…

Your project is looking fantastic!

I'd like to suggest a way to make it even better:

  • Using margin isn't always the most effective method for centering an element.

Here's a highly efficient approach to position an element at the center of the page both vertically and horizontally:

šŸ“Œ Apply this CSS to the body (avoid using position or margins in order to work correctly):

body {
    min-height: 100vh;
    display: flex; 
    justify-content: center;
    align-items: center;
}

I hope you find this helpful!

Keep up the excellent work!

Marked as helpful

1

MisterSixzā€¢ 40

@MisterSixz

Posted

@danielmrz-dev Thank sir!

0

@RobinsonGabriel

Posted

Hi Mistersixz,

Looks pretty good, image sizing and getting everything to cooperate is surprisingly hard right? I spent... an embarrassing amount of time the first run I had with this trying to get it to cooperate.

Are you mainly thinking about how to get something to stay in the absolute center of the screen when you talk about positioning? This is part of what I used that W3C's documentation gives as an example: position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);

Position is necessary for the top and left to do anything. It's a bit rigid, but if say, this was the only thing on the page it would do its job.

I honestly don't think about the box model a lot but I can maybe try to give some ideas: what element is confusing? Is it like what padding vs margin does? Or..?

Marked as helpful

1

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