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

QR code component using HTML + CSS

pure-css
Robbie Tambunting•150
@rtambunt
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?

Having been used to styling with Tailwind, this was a nice refresher of pure CSS. I'm proud that the code is easy to understand and the component looks almost exactly like the design mockup.

In the future, I'd like to style harder mockups with my usual stack (React + Tailwind)

What challenges did you encounter, and how did you overcome them?
  1. Centering a div vertically

Solution: Use a flex container with justify-content + align-items to center the component vertically + horizontally

  1. Using box-shadow variables for a shadow on all 4 sides

Solution: set x and y offset to 0, set a blur radius, optional spread radius, set a color

box-shadow: 0 0 10px 0 hsl(218, 24%, 87%);

What specific areas of your project would you like help with?

How is my vertical-centering solution? Is flexbox the best way to do this?

Is there a cleaner way to organize my CSS?

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 Robbie Tambunting'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

Explore

  • Learning paths
  • Challenges
  • Solutions
  • Articles

Community

  • Discord
  • Guidelines

For companies

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