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

QR Code Component using HTML and CSS

melanielogan74•140
@melanielogan74
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 proud of remembering the semantic tags for HTML.

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

I had challenges with centering the content and making sure the margin and padding worked fine. I also need help with media queries to ensure it works when the browser is resized on a desktop and looks right on mobile.

I also ran into an issue with the .attribution. No matter what size font I entered, the text never changed size. Not sure why this is.

What specific areas of your project would you like help with?

I'd like help on better organizing CSS so I'm not using the same things over and over if I don't have to (i.e. using margin: auto for every ruleset).

Code
Select a file

Please log in to post a comment

Log in with GitHub

Community feedback

  • Jordan Bugglin•410
    @Jbugglin
    Posted 8 months ago

    This is a really good start, kudos to finishing it and putting it out there!

    You mentioned that the attribution class never changed font size when you specified in the CSS file, I've noticed that in the starter index file, in the <head> there is a styling for the attribution class. That may be the cause to the issue you were having, I try to move that to the style.css file and delete the .

    I also noticed that the border radius looks a little off, for the image, take whatever the main card's border radius is and halve it (i.e.: main card border radius is 25px, set the image's border radius to 12.5px), that will make the corner look more consistent.

    Check into learning about flexbox, you can set the intrinsic size of the body (width: 100dvw; height:100dvh;) then add in display: flex; justify-content: center; align-content: center;

    This will center your main card both vertically and horizontally no matter what screen.

    https://www.w3schools.com/csS/css3_flexbox.asp

    Another thing that I noticed, that you used px instead of rem/em for the padding, margin, and font sizes. Take a look into using rem/em, for more responsive elements and spacings.

    https://www.freecodecamp.org/news/css-units-when-to-use-each-one/

    Last thing I'll add, if you set the main card or container width/height, you can size the image this way: img { width: 100%; height: auto; display: block; }

    I know that this is a lot, keep at it and keep learning, it'll make more sense and get easier.

    Marked as helpful

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.

Oops! 😬

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

Log in with GitHub