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

Frontend mentor QR code component solution

Shashank-993•110
@Shashank-993
A solution to the QR code component challenge
View live sitePreview (opens in new tab)View codeCode (opens in new tab)
Code
Couldn’t fetch repository

Please log in to post a comment

Log in with GitHub

Community feedback

  • Oscar Echenique D.•80
    @OscarE2D
    Posted about 2 months ago

    ✅ What’s Done Really Well:

    🧱 Clear and Clean HTML Structure

    • You correctly used fundamental HTML tags (<!DOCTYPE html>, <html>, <head>, <body>).
    • You neatly separated the visual sections: image and text.
    • The use of class names like .white-container, .img-container, and .text is descriptive and semantically helpful.

    🎨 Well-Organized Styles

    • You applied a basic reset with * { margin, padding, box-sizing }, which is excellent for creating a consistent starting point.
    • Great choice of font with Google Fonts (Outfit) and proper use of font-family on the body.
    • The layout is vertically and horizontally centered using Flexbox on the body, which is a great modern practice.
    • The use of soft colors (hsl(212, 45%, 89%) and hsl(0, 0%, 100%)) gives the design a professional and pleasant appearance.

    📱 Responsive Without Complexity

    • The main container’s width (320px) is ideal for mobile, and thanks to flex, it adapts well to most screen sizes without breaking.

    🛠 Suggestions for Further Improvement:

    🧩 1. CSS Placement

    • Although it’s okay to include <style> in the same file for small projects, the ideal practice is to separate the CSS into an external file (styles.css). This improves organization as your project grows.

    🖼 2. Improving Image Accessibility

    • Currently, the alt="" is empty. While valid, it’s better to use a descriptive text such as:

      <img src="./images/image-qr-code.png" alt="QR code linking to Frontend Mentor" />
      

      This helps users who rely on screen readers.

    📐 3. Font Size and Visual Hierarchy

    • The font-size: 15px is fine, but you could consider using rem instead of px to improve accessibility and scalability:

      font-size: 0.9375rem; /* equivalent to 15px */
      
    • You could also use clamp() in the future to make font sizes fluid, like:

      font-size: clamp(0.875rem, 1vw + 0.5rem, 1rem);
      

    🔤 4. Using Relative Instead of Fixed Units

    • Instead of width: 320px, you could practice using units like max-width or clamp():

      max-width: 320px;
      width: 90%;
      

    This makes the layout more adaptable to smaller screens without needing media queries.

    ✨ 5. Optional Semantic HTML

    • Although not required, you might consider using a <main> instead of the div.white-container, and a <section> for the text content. This improves semantic structure for accessibility and SEO.

    🏁 Final Summary:

    The design is clean, well-organized, and functional. The use of Flexbox, Google Fonts, and harmonious colors shows attention to detail.

    🎉 Congratulations! You’re building a very solid foundation. These suggestions are just to help you keep growing and prepare for more complex projects. Keep it up! 🚀

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