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 page with HTML & CSS

ALAUDDIN MUNSHI• 10

@amunshi-dev

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


New learner, so any kind of suggestion will help me. Don't forget to help. Thanks

Community feedback

Old• 6,220

@Old1337

Posted

Hi there,

  • your way of centering the element isn't wrong however, you could do it with flex properties by first removing the position and transform properties from the container and then give the body these properties to center the element display:flex justifiy-content:center align items: center min-height:100vh

  • check the HTML report to fix accessiblity issues

i hope this is helpful and goodluck!

Marked as helpful

0

ALAUDDIN MUNSHI• 10

@amunshi-dev

Posted

@Old1337 Thank you.

1
Prabhash Ranjan• 2,540

@besttlookk

Posted

@amunshi-dev There are common way to center :

  1. Using only flex(which is easiler )
  2. Using position.

I see you used both.

#For flex:

.container{
    // It sould have some height to see the desired result
   display:flex;
   align-item:center;
   justify-content:center;
}

.container{
   position:relative;
}

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

BTW you can also use grid to center.(tho its not that comman)

I hope i helped you. Feel free to write back if it is still not clear

Good Luck #happyCoding

Marked as helpful

0
ALAUDDIN MUNSHI• 10

@amunshi-dev

Posted

@besttlookk Yes, it's very 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