Skip to content
  • Unlock Pro
  • Log in with GitHub
Solution
Submitted 10 months ago

Centered QR Code Modal Using HTML and CSS

Matt Turner•30
@maturner5
A solution to the QR code component challenge
View live sitePreview (opens in new tab)View codeCode (opens in new tab)

Solution retrospective


What are you most proud of, and what would you do differently next time?

Most proud of: Quick implementation of the given design.

Do differently: N/a

What challenges did you encounter, and how did you overcome them?

Challenges:

  • Centering the component both horizontally and vertically. I ended up using absolute position to make margin: auto center the component. I would like to know if this is good practice or not. Here's the code snippet:
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
margin: auto;
What specific areas of your project would you like help with?

Areas for help:

I would like to know if there is was a better/more efficient and good practice way of implementing the design, or if my approach was fine. The two areas of concern I have is my use of absolute position and fixed width and height for the component.

Code
Loading...

Please log in to post a comment

Log in with GitHub

Community feedback

No feedback yet. Be the first to give feedback on Matt Turner's solution.

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

Stay up to datewith new challenges, featured solutions, selected articles, and our latest news

Frontend Mentor

  • Unlock Pro
  • Contact us
  • FAQs
  • Become a partner
  • Use cases

Explore

  • Learning paths
  • Challenges
  • Solutions
  • Articles

Community

  • Discord
  • Guidelines

For companies

  • Hire developers
  • Train developers
© Frontend Mentor 2019 - 2026
  • Terms
  • Cookie Policy
  • Privacy Policy
  • License