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

QR component using html css

mayank1405•100
@mayank1405
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?

This will be my first project after learning some HTML and CSS. So its like the first step, I don't know if there is anything to be proud for exactly since this is a beginner project but I will say that it felt nice to make this.

Next time I will learn more things and try to make it with additional features.

Code
Select a file

Please log in to post a comment

Log in with GitHub

Community feedback

  • Dylan de Bruijn•3,220
    @DylandeBruijn
    Posted about 1 year ago

    Hi @mayank1405,

    Congratulations on completing your first project, it's definitely something to be proud of, even if it's a beginner project. Everyone has to start somewhere, and CSS can be difficult to wrap your head around. I'm happy you had fun making this. It's great you are willing to learn more things and try to come up with additional features, keep that mindset going!

    A bit of friendly constructive feedback:

    • I notice you use inline CSS styling and a separate stylesheet. Good job on linking the stylesheet, that is a good practice. I would suggest getting rid of the inline styling and moving that to your stylesheet. While inline styling has it's uses it's better to put all your styling in a separate file.

    • Try to use more descriptive and reusable CSS classes and ids. An id like #white communicates to me that it would give the element it's put on a white background or text color. You could style your QR code card using a class instead of an ID and name it .qr-code-card for example. Then you could a class on the image inside the card and name it .qr-code-image following the same principle.

    • You have an empty alt attribute on your image. Try giving the image a good description like alt="An image of a QR code". The alt tag helps users with screen readers navigating your website.

    • There are multiple ways to center an element and this is one of the most frequently asked questions about CSS. You could give your body a min-height: 100vh and then try to center it using flexbox. Remember to remove the relative positioning and flexbox on the #white element if you want to try this. At the moment the relative positioning is causing overflow issues.

    Relative documentation:

    Overflowing content

    Centering an element

    I hope you find my feedback helpful, and if you have any more questions feel free to ask them!

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