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 Component Desktop version using HTML and CSS

@AsimKachhap

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


What are the best practices for writing clean CSS code? What is the best way to centre a div?

Community feedback

@dorian-edwards

Posted

If a div has a width < 100% or < 100vw you can use "margin: 0 auto" to center it as well. the 0 sets the margin along the y axis, top and bottom, to 0, and auto will put enough margin on either side of your div along the x axis to set it in the middle of the screen.

The div element is block level by default so this works, if you override the display of your div and make it inline or inline-block, this will no longer work.

1

@CreatorLZ

Posted

Hi. Nice work!. To center a div I generally use this syntax; display:flex; align-items:center justify-content: center

1

@DoriseneO

Posted

this is nice.i think you should have increased your font-size a little.

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