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

HTML5, CSS, Flexbox, Google Fonts, CSS Box Shadow, Media Queries

Partha Dey•80
@ParthaDey5
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? What I Am Most Proud Of

I am proud of successfully replicating the design with clean, structured HTML & CSS while ensuring responsiveness across different screen sizes. I focused on using semantic HTML, proper CSS box model properties, and Google Fonts for better typography.

Additionally, applying box shadows and Flexbox helped me build an aesthetically pleasing UI that closely matches the given design.

What I Would Do Differently Next Time

Next time, I would:

  • Improve accessibility by adding alt attributes with descriptive text for images and enhancing text contrast for better readability.
  • Experiment with animations to add smooth hover effects and transitions for a more interactive experience.
  • Optimize the code structure by using reusable CSS classes and reducing unnecessary styles.
  • Try adding JavaScript to make the QR code interactive (e.g., allowing users to copy the link when clicking the image).
What challenges did you encounter, and how did you overcome them? Challenges Encountered
  1. Understanding Design Specs from Figma

    • Using the Figma file helped get accurate measurements, but interpreting padding, margins, and font sizes required attention to detail.
    • Solution: Used Figma’s inspector to extract exact values instead of estimating, ensuring pixel-perfect accuracy.
  2. Implementing the Exact Layout

    • Translating Figma’s design into HTML & CSS required careful structuring.
    • Solution: Followed a mobile-first approach, using Flexbox to align elements seamlessly.
  3. Ensuring Box Shadows & Effects Matched

    • Replicating Figma’s shadows, spacing, and radius in CSS was challenging, as different browsers render shadows differently.
    • Solution: Experimented with box-shadow settings and cross-checked against Figma values.
  4. Making the Design Fully Responsive

    • While the Figma file showed desktop and mobile versions, adapting the design dynamically required extra work.
    • Solution: Used media queries to ensure smooth scaling on different devices.
How I Overcame Them
  • Utilized Figma's measurement tools to match exact spacing and font details.
  • Applied CSS techniques like box-sizing: border-box and px units for consistency.
  • Constantly checked browser previews to fine-tune responsiveness.
What specific areas of your project would you like help with? Specific Areas Where I’d Like Help
  1. Enhancing Accessibility

    • While I followed the design closely, I’d love feedback on improving accessibility, like adding better alt descriptions for images and ensuring proper color contrast.
  2. Improving Responsiveness Across Devices

    • I used media queries, but I’d like suggestions on how to better optimize layouts for smaller screens beyond just adjusting padding and font sizes.
  3. Refining Box Shadows & Effects

    • Achieving the exact shadow and spacing effect from Figma was tricky. Any tips on perfecting CSS box-shadow values for consistency across browsers would be helpful.
  4. Code Structure & Best Practices

    • I want to ensure my CSS is clean, efficient, and follows best practices. Would appreciate feedback on whether I could simplify styling or improve maintainability.
  5. Potential JavaScript Enhancements

    • Right now, the project is static, but I’m curious if adding a small interactive feature (like a hover effect on the QR code) would enhance the experience.

Code
Select a file

Please log in to post a comment

Log in with GitHub

Community feedback

No feedback yet. Be the first to give feedback on Partha Dey'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

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.