Skip to content
  • Unlock Pro
  • Log in with GitHub
Solution
Submitted 23 days ago

QR code component using CSS media query

Ezemaolisaemeka•50
@Ezemaolisaemeka
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 successfully completing the challenge using only HTML and CSS, and that my design closely matched the given design files for both desktop and mobile views. I also learned how to make the layout responsive using media queries.

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

One challenge I faced was making the project responsive for smaller screen sizes like 375px. At first, the layout looked broken on mobile devices. I overcame this by using a media query to adjust the container width and padding for small screens.

I also had some trouble with the alignment and spacing of the text and image inside the card. I fixed this by using text-align: center and adjusting margins and padding based on the design preview.

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

I would appreciate feedback on how I structured my CSS especially on whether I followed best practices for responsiveness.

I’m also curious if there's a better way to handle the responsive design for screen sizes around 375px and up.

Code
Select a file

Please log in to post a comment

Log in with GitHub

Community feedback

  • stephany247•730
    @stephany247
    Posted 19 days ago

    Hi Olisa,

    You did a great job on this project — well done! 🎉 Your layout is clean, the design looks visually appealing, and your code is structured in a way that shows you understand the basics of HTML and CSS. I'm proud of the effort you put into this.

    Here are a few specific things I really liked:

    • ✅ Clean layout and visual styling – The use of spacing, border-radius, and colors made the component pleasant to look at.
    • ✅ Good use of Flexbox to center your content both vertically and horizontally.
    • ✅ Responsive design – It's great that you added a media query and thought about different screen sizes.

    Now, here are a few areas you can improve on:

    1. Accessibility: The image is missing a descriptive alt attribute. This is important for users who rely on screen readers, and also helps with SEO. For example, instead of:

      <img src="..." alt="">
      

      You could write:

      <img src="..." alt="QR code linking to Frontend Mentor website">
      
    2. Responsive Design: Your media query works, but the range is quite wide. As you grow, consider using more specific breakpoints based on actual device sizes (e.g., 768px for tablets, 1024px for small laptops).

    3. Code Maintainability: Try to comment your code more and use clearer class names. This makes it easier to maintain and collaborate on.

    4. Interaction & Feedback (Optional): You could take the UI a step further by adding small interaction styles like hover effects or subtle animations.

    🌟 Final Thoughts:

    This was a strong submission. You’ve shown a solid understanding of structure and styling. With just a bit more focus on accessibility and best practices, you’ll be building even more professional projects in no time. Keep up the great work, and keep practicing!

    If you have any questions about the feedback or want to try improving the project based on it, feel free to ask.

    👏👏👏

    Marked as helpful
  • RASHAD09•20
    @RASHAD09
    Posted 23 days ago

    (Good Practices)

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

Oops! 😬

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

Log in with GitHub