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

MrNomis• 40

@MrNomis

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 still don´t know what is the right way to center a div horizontally and vertically... if anyone can help with that it would be very appreciated.

Community feedback

Kelvin• 915

@Kl3va

Posted

display: flex Justify content: center //aligns items along its main axis(horizontally) Align items: center. // aligns items along its cross axis (vertically). By default display set to flex keeps items in a row form.

0

@moheb2000

Posted

Good work 🌸🌸🌸

If you want to center a component with flexbox you can use this:

.your_div {
  display: flex;
  justify-content: center;
  align-items: center;
}

and the parent element for your div must have height: 100%;

Some other suggestions for achieving a better work:

  1. Don't use h3 if you don't have h1 and h2. Use h1 instead and change its styles with css
  2. Use margin and max-width instead of using width and height and also use rem unit instead of using pixels

I hope my advice help you. Keep going! 🌸🌸🌸

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