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

QR Code

Danielle•30
@danilscodes
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 glad that the challenge was not overly complicated for me

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

challenges:

  • thinking about which CSS layout i should use, i had to review them and then determine which one i thought would work best for the page
  • also, for some reason when i wanted the attribution div to be fixed to the bottom of the viewport, it gave the body these extra margins and i have no idea why, so i had to fix that by just putting margin: 0 on the body
What specific areas of your project would you like help with?

questions i have:

  • do you think choosing flexbox for this page was the right choice? i'd really like to understand better when i should use which layout
  • why when i tried to fix the attribution div to the bottom of the viewport extra margins were added to the body??
  • i didn't do a mobile version because it seemed to me that the normal web version would work fine on mobile too. is a mobile version really necessary? if so, how should i implement that?
Code
Select a file

Please log in to post a comment

Log in with GitHub

Community feedback

  • Grace•32,130
    @grace-snow
    Posted over 1 year ago

    This is overflowing my screen - probably because of fixed width but let's get to that in a minute as there are more foundational improvements to make first...

    1. All content should be contained within landmarks. This needs a main wrapping the component and a footer for the attribution.
    2. When building single components think about the context where they would be used. This is not a full Web page but would sit somewhere within a web page, possibly alongside other similar components or QR cards for other websites. That gives you a steer on what the html needs. It's great you've used a h2 not a h1 because this wouldn't be the page title. But is "QR code" a descriptive enough image description? What if there were more of this component on a page? Every image can't be described the same if they go to different websites can it. So make that description richer. Say what it is (QR code) and where it goes (to FrontendMentor.io)
    3. Make sure you update your attribution link eg to your frontend mentor profile page.
    4. get into the habit of including a full modern css reset at the start of the styles in every project. Andy Bell has a good one you can look up and use.
    5. Never limit the height of elements that contain text, including the body. It's fine to use min-height but not height. Min height 100vh allows the element to extend beyond the minimum set if and when it needs to.
    6. Same goes for the component. You must remove the height from that. All that can cause is overflow bugs when a user has a different text size, font family or line height; or when an editor writes more words in a card. There is no need for a min height either in this case. Let the browser do it's job and decide what height is needed based on the content of the card.
    7. The card must not have a width either. All it needs is a single max width in rem. That allows it to fill the available space up until that width, but also allows it to shrink narrower when viewed on a smaller screen. It should be in rem so the layout works for all users including those who have a different text size.
    8. don't style on IDs thats not what they are for. In fact you must remove any IDS from this components html! IDs must always be unique on a page and as already mentioned its likely that card components would repeat. (In future challenges you'll learn how to make IDs unique but don't worry about that now).
    9. You can place text align center on the card component in this instead of repeating it on the card child elements. It's a property that would be inherited.

    FYI @LuciaVerde and @nonoza you may like to read the above feedback on this challenge as you also reviewed it 🙂

    Marked as helpful
  • Pretty Kunene•690
    @nonoza
    Posted over 1 year ago

    Heya!!

    First of all, congrats in completing the project. You did very well.

    To answer your Questions (My opinion):

    • Yes, I also use it. We all have different says to solve the problem . So your styling might not be the same as mine but aslong what you know what the property does and know how will solve a an issue , then you are good.
    • Suggestion : I would give a margin bottom to a container to push the attribute down.

    Otherwise good job.

  • Lucia Verde•60
    @LuciaVerde
    Posted over 1 year ago

    I don't have much to say, I think it's a very good project. I can only suggest you to rename the css file to style.css because "index" is normally used for html file. Also, instead of using fixed values for the height and width of the .white-container consider using relative measurement units for a more responsive design. Keep going, you got this!

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

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.

Frontend Mentor for Teams

Frontend Mentor for Teams helps companies and schools onboard and train developers through project-based learning. Our industry-standard projects give developers hands-on experience tackling real coding problems, helping them master their craft.

If you work in a company or are a student in a coding school, feel free to share Frontend Mentor for Teams with your manager or instructor, as they may use it to help with your coding education.

Learn more

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