Skip to content
  • Unlock Pro
  • Log in with GitHub
Solution
Submitted over 1 year ago

QR-code-coding-challenge

web-components
HendKH•10
@HendKH
A solution to the QR code component challenge
View live sitePreview (opens in new tab)View codeCode (opens in new tab)

Solution retrospective


The project wasn't difficult. I'm sure of my code .But , I wonder If it be more optimised in another way ?Your suggestions , please :) thank you .

Code
Loading...

Please log in to post a comment

Log in with GitHub

Community feedback

  • Kimo Spark•2,190
    @kimodev1990
    Posted over 1 year ago
    • It's better in the future to avoid giving your design sizes definite values such as your div with class container width: 1440px and div with class QR-content width: 280px margin-top: 140px, It's better to give percentage values to make your design flexible, for example you could assign width: 40% to class QR-content, So It's width will be 40% in relative to div class container.
    • You'd better check on clamp ( ) method ( font-size, width, etc.), so your design sizes will change according to the viewport dimensions ( Responsive Design ) and will be suitable for any device layout.

    Hope You find this Helpful.

    Other than that, Nice work & keep Going on.

    Marked as helpful
  • Enmanuel Otero Montano•2,155
    @Enmanuel-Otero-Montano
    Posted over 1 year ago

    Hello @HendKH!

    Your solution is good, but I would like to make a couple of suggestions.

    Regarding what you ask about how to optimize your code, it is difficult to make an assessment about this in this project, since it is a project that does not need much code, perhaps in a project that requires more code you can see if there is room for improvement , but I'm going to the point, something that I could find in this project is that you establish at the beginning of your code margin and padding 0 for all elements and in my opinion this is not optimal, since there are elements that have padding or margin by default , with this there is a high probability that you will have to apply margin or padding to an element that already had one of these characteristics removed at the beginning of the code.

    At this point you may think that the margin and padding of the default elements may never match the ones you want to apply, so you will always have to apply these properties to the elements, and that may be the case, but still It is not a reason to apply margin and padding 0 to all elements because if we look at how the browser interprets the code, you are requiring the browser from the beginning to set margin and padding to all elements at 0, so that it can later apply these properties again in the elements with the values ​​that you establish, this definitely in larger projects would somewhat affect the loading speed of your website, which is not good for the user experience or for positioning in search engines.

    I hope you understand what I'm trying to explain, if not, you can ask again. I forgot to tell you that I do agree with box-sizing: border-box;

    One last thing, always write the styles in a separate file to the HTML file.

    Greetings

    Marked as helpful
  • P
    Daniel 🛸•44,790
    @danielmrz-dev
    Posted over 1 year ago

    Hello @HendKH!

    Your project looks excelent!

    I just have one minor suggestion:

    • You can replace your div.container with main.container. This won't change anything visually, but will make your project more semantic. We use semantic tags to improve the SEO optimization and accessibility of the project.

    I hope it helps!

    Other than that, you did a great job!

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

Oops! 😬

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

Log in with GitHub