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

QR Code component using basic HTML and CSS

Franz Dale Abarquez•20
@fabarqz
A solution to the QR code component challenge
View live sitePreview (opens in new tab)View codeCode (opens in new tab)

Solution retrospective


  1. What's your approach when deciding for the measurements of the elements of your website using CSS units?
Code
Select a file

Please log in to post a comment

Log in with GitHub

Community feedback

  • Aaron Varga•370
    @avinno
    Posted over 1 year ago

    Hey! Great job on your solution here!

    In regard to your question and some suggestions I have for you for this solution:

    • I would try not to specify height on containers or major bodies of content so that you can let the content naturally flow down the page as needed. With regard to your solution code, I am specifically talking about your div.qr-card. For the div.qr-card I would not set a "min-height".
    • I would not set your footer position to fixed. I think you are doing this to keep it at the bottom at all times, but you can achieve this a different way to avoid other issues like the footer overlapping your content on smaller screens such as with displaying flex and using the flex-grow property, etc. I challenge you to look into that if you are interested.
    • I see you have set widths for certain elements as well. While this may be necessary in special cases, I would recommend not doing this where you have done it and let widths be a natural 100% and use padding and margins to achieve any space you may need. Using exact heights and widths are not inherently responsive, so using units like percentages, flex, and grid will allow your content to naturally grow in height and width as needed with respect to window size/device size.

    In direct response to your question:

    In summary, I would suggest ONLY setting exact heights or widths if it is absolutely necessary for something specific, for example, an icon or image that does not need to take up a full width or height, but overall large areas of content you can likely let naturally fill the page with restricting it to any specific height or width unless it is a percentage like 100% or if you have a two column flexbox, you may set each to 50%, etc. Of course, these are my personal opinions, but at all costs, I let my page content flow naturally until I have an absolute need to specifically size something (again, such as an icon or image, etc.). This makes for a more responsive page. If you start setting exact heights and widths for elements all over your page, when you resize your window or look at it on a small device, you are going to have overflow problems and it will become a mess.

    I hope that helps! Great job on this project! I look forward to seeing more of your solutions and maybe updates to this one if you wish to make 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