Skip to content
  • Learning paths
  • Challenges
  • Solutions
  • Articles
  • Unlock Pro
  • Log in with GitHub
Solution
Submitted 11 months ago

QR Code Component using BEM

bem
Eugene Vuong•40
@EugeneVuong
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?

I am proud of my usage of the BEM in my CSS as it structures everything cleanly. Next time, I want to try to use CSS Sass, so I can remove some redundant code.

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

One challenge I encountered was moving the image to the center of the card. I overcame it by using padding on the card.

What specific areas of your project would you like help with?
  1. I would like to know if my usage of the HTML5 semantic is used correctly.
  2. I would like to know if my QR code component is responsive.
  3. I would like to know if using REM (instead of REM) through my CSS is a good idea. If it is not, what parts of my design require the px instead of REM? 3A. When is using PX better than using REM (in general and in the case of the QR Code)?
  4. Am I using the BEM structure right?
Code
Couldn’t fetch repository

Please log in to post a comment

Log in with GitHub

Community feedback

  • Grace•32,130
    @grace-snow
    Posted 11 months ago

    This is a really nice solution. I only have a few small tweaks to suggest:

    1. Give the body a little padding or the component a little margin on all sides so it can't hit screen edges as it's doing now.
    2. The alt text can be shorter. "QR code to FrontendMentor.io" is fine. I wouldmt say "that links to" as that implies you've wrapped it in a link.
    3. You don't need to import the font twice. Just choose the specific fonts and weights you want and include that one snippet Google fonts provides. You never need to include the preconnect fonts twice in particular.
    4. Personally I wouldnt use article for this. It's fine to do if you want but there's no benefit to doing it and I'm not sure this is really what article was intended for. The card definitely shouldn't have a section element inside it. You could make this whole card a section if you wanted but not it's inner parts. Again there would be no actual benefit to making it a section except perhaps making the code slightly easier to read/understand as a card is mentally a "section" of content when we look at a design.
    Marked as helpful

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
Frontend Mentor logo

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

Oops! 😬

You need to be logged in before you can do that.

Log in with GitHub

Oops! 😬

You need to be logged in before you can do that.

Log in with GitHub

Frontend Mentor for Teams

Frontend Mentor for Teams helps companies and schools onboard and train developers through project-based learning. Our industry-standard projects give developers hands-on experience tackling real coding problems, helping them master their craft.

If you work in a company or are a student in a coding school, feel free to share Frontend Mentor for Teams with your manager or instructor, as they may use it to help with your coding education.

Learn more

Oops! 😬

You need to be logged in before you can do that.

Log in with GitHub