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 HTML/CSS

@arunkanaujia23

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


Can anyone help me with how to Vertical Align the div?

Community feedback

P

@CharlieCastleWeb

Posted

Hi Arun ! Great work, anyway!

The solution I use to center the main content is:

  • Give both the html and body a height of 100%
  • On the body selector apply display: flex, align-items:center, justify-content: center
  • Then in order to leave the footer at the bottom you'll need to apply margin-top: auto to both the main and footer selectors.

Hope this works, let me know if you need more help

Marked as helpful

0

@Baradit

Posted

Nice solution buddy! To center the div, you can use this code into your body: height: 100vh; display: grid; place-content: center; Keep it going!

Marked as helpful

0
Keytron 270

@Dev-Tron

Posted

There are many ways to center a div. In your case you could try giving your body a margin-top value of maybe 10% or so.

Marked as helpful

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