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

QR code component

Harshini P Kumar•100
@harshinichandu
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’m most proud of how clean and responsive the QR Code Component turned out, especially considering it was built using just HTML and CSS. I ensured the layout was mobile-first and centered the component using Flexbox, which made the design look polished across devices.

If I were to do this challenge again, I would:

Use CSS variables to make theme color updates more efficient.

Add hover effects or transitions to enhance interactivity, even if just for practice.

Possibly try SCSS or another CSS preprocessor to experiment with modular styles.

Make the component accessible by adding ARIA roles or improving semantics.

This challenge helped reinforce my CSS fundamentals and layout techniques.

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

One of the main challenges I faced was aligning the component perfectly in the center of the page across different screen sizes. At first, using margins and padding didn't give consistent results. I overcame this by using Flexbox to center the component both vertically and horizontally, which made the layout much more reliable and responsive.

Another challenge was getting the sizing, spacing, and font styles to match the design mockup, especially without access to the exact Figma/Sketch file. I relied on visual approximation and the style-guide provided, which helped a lot. It also taught me how to fine-tune layout using rem, em, and px units effectively.

Lastly, organizing the CSS for such a small project in a readable way was something I focused on. I kept the styles clean and scoped, which improved maintainability and helped me stay consistent with naming and formatting.

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

Design accuracy – How close is my implementation to the original design mockup? Any tips on improving visual precision?

Responsiveness – While it looks fine on most screen sizes, I'd appreciate suggestions on making the layout more adaptable and pixel-perfect across devices.

Code organization – Is my CSS structured well? Could it be more modular, or are there best practices I should follow even for small components like this?

Accessibility – Are there any accessibility improvements I can make, such as better semantic tags or ARIA roles?

Optimization – Are there ways to reduce redundancy or improve performance in such a minimal component?

Code
Select a file

Please log in to post a comment

Log in with GitHub

Community feedback

  • Peepytoo•110
    @Peepytoo
    Posted 3 months ago

    Maybe consider adding an href attribute to your name at the text "coded by _".

    I noticed you used internal style sheeting for your CSS code. Although there isn't a problem with this, you might want to consider using external style sheeting in future projects; the following link explains the differences and the benefits of external style sheeting: https://www.reddit.com/r/webdev/comments/ms3lw5/internal_vs_external_style_sheet/

    I would also just fix some basic formatting issues in the text and elements.

    • the font of your code doesn't exactly match up with the font in the solution, unless it's just because I can't load the font. An alternative method to import fonts is using googlefonts and copying and pasting the font code into the header tag of your HTML document, and then you can use the font-family outfit.
    • another small thing is the margins of the box element, which can be exactly determined through the use of the Figma application which can give you details on all the properties of the solution preview.

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

How does the accessibility report work?

When a solution is submitted, we use axe-core to run an automated audit of your code.

This picks out common accessibility issues like not using semantic HTML and not having proper heading hierarchies, among others.

This automated audit is fairly surface level, so we encourage to you review the project and code in more detail with accessibility best practices in mind.

How does the CSS report work?

When a solution is submitted, we use stylelint to run an automated check on the CSS code.

We've added some of our own linting rules based on recommended best practices. These rules are prefixed with frontend-mentor/ which you'll see at the top of each issue in the report.

The report will audit all CSS, SCSS and Less files in your repository.

How does the HTML validation report work?

When a solution is submitted, we use html-validate to run an automated check on the HTML code.

The report picks out common HTML issues such as not using headings within section elements and incorrect nesting of elements, among others.

Note that the report can pick up “invalid” attributes, which some frameworks automatically add to the HTML. These attributes are crucial for how the frameworks function, although they’re technically not valid HTML. As such, some projects can show up with many HTML validation errors, which are benign and are a necessary part of the framework.

How does the JavaScript validation report work?

When a solution is submitted, we use eslint to run an automated check on the JavaScript code.

The report picks out common JavaScript issues such as not using semicolons and using var instead of let or const, among others.

The report will audit all JS and JSX files in your repository. We currently do not support Typescript or other frontend frameworks.

Oops! 😬

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

Log in with GitHub