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 with media query

@moheb2000

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 have some problems with centering elements on screen. I know how I can center an element with flexbox but in small screens, I see some weird results. Thanks!

Community feedback

@NimaFrEeMaN

Posted

Hi, you can center your elements by giving your element these properties

{ position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); }

Marked as helpful

1

@moheb2000

Posted

@NimaFrEeMaN Really thanks.

0

Account Deleted

you can center the element by giving the body these properties display:flex; justify-content:center; align-items:center; height:100vh;

don't forget to mark this as helpful !

Marked as helpful

1

@moheb2000

Posted

@Old1337 Thanks! I used this method before and in small screens my card became very small. I think for small screens I should use media queries anyway.

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