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

html, Scss

@Lc-Olimpio

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


Did some improvements with the feedback I recieved, thanks for that! Hope everything is better now.

Community feedback

Adriano 34,090

@AdrianoEscarabote

Posted

Hi Lucas Olimpio da Silva, how are you?

I really liked the result of your project, but I have some tips that I think you will like:

1- Every pages needs a <h1> to show which is the most important heading. So replace the <h2> with <h1> and follow the sequence h1-h5

2- All page content should be contained by landmarks, you can understand better by clicking here: click here

We have to make sure that all content is contained in a reference region, designated with HTML5 reference elements or ARIA reference regions.

Example:

native HTML5 reference elements:

<body>
    <header>This is the header</header>
    <nav>This is the nav</nav>
    <main>This is the main</main>
    <footer>This is the footer</footer>
</body>

ARIA best practices call for using native HTML5 reference elements instead of ARIA functions whenever possible, but the markup in the following example works:

<body>
     <div role="banner">This is the header</div>
     <div role="navigation">This is the nav</div>
     <div role="main">This is the main</div>
     <div role="contentinfo">This is the footer</div>
</body>

It is a best practice to contain all content, except skip links, in distinct regions such as header, navigation, main, and footer.

Link to read more about: click here

2- Why it Matters

Navigating the web page is far simpler for screen reader users if all of the content splits between one or more high-level sections. Content outside of these sections is difficult to find, and its purpose may be unclear.

HTML has historically lacked some key semantic markers, such as the ability to designate sections of the page as the header, navigation, main content, and footer. Using both HTML5 elements and ARIA landmarks in the same element is considered a best practice, but the future will favor HTML regions as browser support increases.

Rule Description

It is a best practice to ensure that there is only one main landmark to navigate to the primary content of the page and that if the page contains iframe elements, each should either contain no landmarks, or just a single landmark.

Link to read more about: click here

Prefer to use rem over px to have your page working better across browsers and resizing the elements properly

The rest is great!!

Hope it helps...👍

Marked as helpful

1
Lucas 👾 104,420

@correlucas

Posted

👾Oi Lucas Olimpio da Silva, tudo bem? Parabéns pelo desafio! Seja bem vindo a comunidade do Frontend Mentor

Acabei de ver sua solução e tenho umas dicas pra melhorar seu código/design:

1.Ao invés de usar <p> pro bloco contendo o título principal, ao invés use <h1>, porque cada página precisa de um h1 pro título principal e siga a sequência se você adicionar outro título como h1, h2 , h3…

2.Use unidades relativas como rem ou em em vez de px para melhorar seu desempenho redimensionando fontes entre diferentes telas e dispositivos. Para fazer um site mais acessível, o ideal seria usar rem em vez de px. O REM não se aplica apenas ao tamanho da fonte, mas também a todos os tamanhos.

3.Substitua o div por <main> (toda página deve ter um landmark principal e também um título principal h1)

4.O seu componente já está com o design pronto, um bom exercício para melhorar seu código, seria criar a estrutura mais limpa o possível e reduzir seu código ao máximo. Por exemplo, você pode segurar todo conteúdo em um bloco só usando (<main> ou <div>) nesse caso vamos usar <main> por que é uma tag semântica. Se você notar, nem precisa adicionar nenhum div além da principal para segurar o conteúdo (img, h1 e p). A estrutura ideal e mais limpa possível para esse desafio é essa aqui:

<body>
<main>
<img src="./images/image-qr-code.png" alt="QR Code Frontend Mentor" >
 <h1>Improve your front-end skills by building projects</h1>
<p>Scan the QR code to visit Frontend Mentor and take your coding skills to the next level</p>
</main>
</body>

👋 Espero que essas dicas te ajudem e que você continue no foco!

Marked as helpful

1
Vanza Setia 27,795

@vanzasetia

Posted

Hi, Lucas! 👋

There's nothing wrong with setting display: flex to the body element. 🙂

But, setting height and max-width on the body element will make the body element less responsive.

  • For the height, it will not allow the body element to grow if the page content needs more than 100vh of the user's screen size. Use min-height instead.
  • Remove max-width from the body element. body element should always fill the entire page on all screen sizes. Treat it as the page element of the website.

Use single class selectors for styling whenever possible. The stylesheet has high specificity. For example, body div.container main.main div.texts p. When using Sass, I recommend only nesting when you want to style pseudo-elements, pseudo-classes (:hover, :focus, etc) and @media queries. It's a good practice to keep the CSS specificity as low and flat as possible.

Hope this helps!

Marked as helpful

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