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 solutions using HTML and CSS

#accessibility

@Errorman2003

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


How do you center your div perfectly?

Community feedback

@osmannurierdogan

Posted

Hi @Errorman2003,

I centered the div with the following code for this challenge. It may not be the perfect solution but it works for me. :D If you have better solution, you can reply my message, I would be happy for that :)

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

0

@daniloarcidiacono

Posted

If you have only a single tag inside body, you can try to use flexbox:

html, body {
height: 100%;
}

body {
display: flex;
justify-content: center;
align-items: center;
}
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