Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found

Submitted

QR code component

@vinayak912002

Desktop design screenshot for the QR code component coding challenge

This is a solution for...

  • HTML
  • CSS
1newbie
View challenge

Design comparison


SolutionDesign

Solution retrospective


What are the best resources to learn javascript?

Community feedback

Lucas 👾 104,420

@correlucas

Posted

👾Hi @vinayak912002, congratulations on your solution!👋 Welcome to the Frontend Mentor Coding Community!

Great solution and a great start! From what I saw you’re on the right track. I’ve few suggestions for you that you can consider adding to your code:

  • You've done the design for the wrong image, when you download the starter files the folder comes with 3 files (preview card, desktop and mobile) you've created the solution based on the preview and you should consider only the mobile + desktop images.Remove the background-color from the container and add it to the body to make sure this color background will display it full screen.
  • Use <main> instead of a simple <div> this way you improve the semantics and accessibility showing which is the main block of content on this page. Remember that every page should have a <main> block and that <div> doesn't have any semantic meaning.
  • Replace the <strong> containing the main title with <h1> note that this title is the main heading for this page and every page needs one h1 to show which is the most important heading. Use the sequence h1 h2 h3 h4 h5 to show the hierarchy of your titles in the level of importance, never jump a level.
  • Add a margin of around margin: 20px to avoid the card touching the screen edges while it scales down.
  • Use relative units as rem or em instead of px to improve your performance by resizing fonts between different screens and devices. These units are better to make your website more accessible. REM does not just apply to font size, but to all sizes as well.

Here's my solution for this challenge if you wants to see how I build it: https://www.frontendmentor.io/solutions/qr-code-component-vanilla-cs-js-darklight-mode-nS2aOYYsJR

✌️ I hope this helps you and happy coding!

Marked as helpful

1
T
Grace 29,310

@grace-snow

Posted

I'm afraid this doesn't look finished yet. It's not at all like the design.

Here are some tips:

  • use a modern css reset at the start of every project. Look them up. Josh Comeau and Andy Bell both have good examples. This will do things like remove margin from body, set images to display block etc
  • do not use margin to center a component on the screen. Use flex/grid properties along with min-height 100vh on the body in this challenge
  • It's great you've used max width on the card, but 200px is too small. Make it larger and I recommend using rem unit instead
  • use the colors and font family from the style guide. e.g. background color and font color is not right on this
  • you will need to link the font family from Google fonts in the head of your document and then use the family in CSS
  • use the font size from the styleguide on body, but convert it to REM (font size should never be in px)
  • use landmarks - this should have a main element at least. The attribution should not be in the card, so make that a footer on the page
  • choosing the correct html elements is really really important. This card should have an img, a heading element and a paragraph, that's all. No strong tag
  • alt text on an important image needs to be a human-readable description, not a hyphenated string like you'd use for a class name. This image should say "QR code to frontendMentor.io"
  • Do not use br element. It's rare you'll need it, but definitely not for things like this when it should be two block elements, a heading and a paragraph
  • let the img be width 100%. It does not need left/right margin
  • Don't rely on line height from the browser, say how you want the text in headings and body to look. Line height should at least be 1.2 for headings and 1.5 for body usually
  • Same with margins. Don't rely on browser defaults which can vary across browsers. You should be setting margin top/bottom on the elements inside the card.
  • Use classes directly on what you want to style in CSS. Try not to use nested element selectors like .class-name element as this increases the specificity of the selectors and makes CSS hard to work with on bigger projects. It doesn't matter so much on a tiny project like this, but could matter a lot on big projects.
0

@ojaswishivam

Posted

Hello @vinayak912002

0

T
Grace 29,310

@grace-snow

Posted

@ojaswishivam this is very strange feedback for this solution!

0

@ojaswishivam

Posted

@grace-snow I only replied to what he had asked

0
T
Grace 29,310

@grace-snow

Posted

@ojaswishivam ah I didn't see that question.

It's good to point people to the Frontend mentor resources page, that has lots of ideas too

0

Please log in to post a comment

Log in with GitHub
Discord logo

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