Not Found
Not Found
Your session has expired please log in again.
Your session has expired please log in again.
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 Components

Godbless Ikadoiā€¢ 100

@TariCodes

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


Any feedback is welcomed!!!

Community feedback

T
Graceā€¢ 29,310

@grace-snow

Posted

Hello

There are some important principles to learn in this challenge

  1. Content should always be contained within landmarks. That means you need a main at least on every page so it's good to get into that habit now. Place the attribution content in a footer landmark outside of main too.
  2. Learn about image alt text, what it is and how to use that attribute in meaningful vs decorative images. There is a good post in the discord resources channel about how to write good alt text. In this, you must Change the alt text you have written so far. It is not code, it is content. It needs to say what the image is (QR code) and where it goes (to FrontendMentor.io)
  3. Keep html as simple as possible. Think about this. Do you need a text div at all in this?
  4. Always use a modern css reset at the start of the styles. Andy Bell has a good one you can look up and use.
  5. The component max width should be in rem not px. This avoids a horrible narrow card for users who enlarge their font size.
  6. IMPORTANT - never write font size in px! Use rem.
  7. Keep css selectors as low specificity as possible. Use single class selectors not nested selectors if at all possible

Marked as helpful

1
P
solvmanā€¢ 1,670

@solvman

Posted

Hi @TariCodes,

Great job completing this project! šŸŽ‰

I have a couple of suggestions:

šŸ“Œ First: You should swap colors for the body background and paragraph text.

šŸ“Œ Second: You should always start with <h1> element, not <h2>. In HTML, <h1> through <h6> tags are used to define headings, with <h1> being the highest level. Using them in order helps maintain the semantic structure of the document. It is important for SEO, accessibility, and semantic correctness. When you think of an h-tag, think not of style and size but more of the semantic structure of the document.

šŸ“Œ Third: wrap the main content of your HTML in the <main> element, which is also a semantic element representing the document's main content. Remember, <div> is not a semantic element and does not provide any meaning for SEO and accessibility. Instead of <div class="card-wrapper"> you should do <main class="card-wrapper">.

Otherwise, very well done! šŸŽ‰šŸš€ā¤ļø

Marked as helpful

0

Godbless Ikadoiā€¢ 100

@TariCodes

Posted

@solvman Thanks for your preview, I'll make changes to it as you've specified

1
T
Graceā€¢ 29,310

@grace-snow

Posted

@solvman this is a card component, not a full Web page so h2 is the correct choice of heading level in this case.

It's true that headings must always go in order and that's a great principle to share. But a h1 only applies to full web pages.

Part of planning html is thinking about the context of where this "thing" you're building will be placed. If it's a whole page design you have to consider where the h1 is in the design (sometimes it is absent from the visible design so you have to add a visually-hidden h1 for example) then plan ea h subsequent heading level. But in a single card component it is almost always going to be lower heading levels like h2 or h3.

If in doubt, choose the higher level (h2)

I hope this clarification is helpful

1
P
solvmanā€¢ 1,670

@solvman

Posted

@grace-snow, Thank you šŸ™ for very helpful clarification šŸŽ‰

0
P
solvmanā€¢ 1,670

@solvman

Posted

@grace-snow Can multiple <h1> be used if they are within the context of <article> (one per article), with multiple <article> elements per page? What confuses me is that according to HTML5 specifications, each article, section, and nav element can have its hierarchy of headings, starting with h1. For example:

<article>
  <h1>Article Title 1</h1>
  <p>Content for article 1...</p>
</article>

<article>
  <h1>Article Title 2</h1>
  <p>Content for article 2...</p>
</article>

Do you know if this is valid?

0
T
Graceā€¢ 29,310

@grace-snow

Posted

@solvman the html spec has never been fully followed, so although this is technically valid, in practice having multipe h1s on a page is not recommended as it creates a load of confusion for assistive tech users.

It is much better for articles and sections to be labelled with h2s.

1
Mariuszā€¢ 120

@MariusG1991

Posted

Hi,

Good job, one thing I would change is text color in the description paragraph, use darker one for better readability, u can use coolors site for checking contrast ratio between text and background color.

1

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