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

alaina96 10

@alaina96

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 you most proud of, and what would you do differently next time?

I'm happy I had enough knowledge to replicate the style of the page without needing assistance. I would spend more time learning flexbox so I don't have to redo part of the project.

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

I have no knowledge of flexbox positioning, so I had to look for help on discord.

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

I am having issues with having my images show up on my github site. I need to figure out what I've done wrong.

Community feedback

T
Grace 29,310

@grace-snow

Posted

Hi I hope these tips are helpful. They should set you up well for future projects as well...

  1. All content should be contained within landmarks. Wrap the container div (the QR code card component) in a main. This isn't strictly necessary for a single component challenge but is a good habit to get into straight away so it doesn't get missed later. (Every page must have a main).
  2. The image in this is really important content, the most important in fact. That means it needs really good alt text. This should say what the image is (QR code) and where it goes (to FrontendMentor.io). Imagine there are several QR cards on a page (very common for card components like this) — it would be no good if every image had the same alt text of "QR code" only. Give it more info.
  3. All content cannot be headings. Headings are extremely important elements and must be used appropriately. They are what communicates the structure of the content on a page and how many people navigate when using assistive tech like screen readers. Looking at the design, this component should have one heading and one paragraph.
  4. There is no need for a strong tag in this. That is for adding emphasis.
  5. Get into the habit of including a full modern css reset at the start of the styles in every project. Andy Bell or Josh Comeau both have good ones you can look up and use.
  6. Font size must never be in px. This is very important.
  7. The card should have padding on all sides and the child elements inside the card should only have vertical margins. Make sure you understand the difference between padding and margin.
  8. The max width on the component should be in rem not px. This allows it to scale correctly for all users, even those of us who change their default text size.
  9. Border radius should not be in percentage unless you have a square or circular item. For rectangular shapes (like this card) the border radius becomes distorted because the sides of the component are not equal. Use a fixed unit like px (or rem if you want the border radius to scale with the chosen text size).
  10. The image must not have a max width in px. This should be max width 100% so it can't ever exceed it's container (already included in modern css resets). You can optionally add a width 100% if you like but this isnt strictly necessary.

Marked as helpful

0
CHarvey820 190

@CHarvey820

Posted

I like the way you used percentages for the border-radius!

0

T
Grace 29,310

@grace-snow

Posted

@CHarvey820 note percentage for border radius should only be used when items are always square or circular. If the element would ever be rectangular, percentage border radius would break it! That would cause very strange looking radiuses because it is calculated on each axis - so a % on one side will be different to the other unless the content has an aspect ratio of 1/1 (i.e. A square or a circle)

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