Skip to content
  • Unlock Pro
  • Log in with GitHub
Solution
Submitted almost 3 years ago

QR code component

cube-css
Cesar Augusto•40
@csaraugustol
A solution to the QR code component challenge
View live sitePreview (opens in new tab)View codeCode (opens in new tab)
Code
Select a file

Please log in to post a comment

Log in with GitHub

Community feedback

  • Lucas 👾•104,160
    @correlucas
    Posted almost 3 years ago

    👾Fala César, tudo bem? Parabéns pelo desafio!

    O seu componente já está com o design prontoum bom exercício pra melhorar seu código, seria criar a estrutura mais limpa o possível e reduzir seu código ao máximo. Por exemplo, você poode segurar todo conteúdo em um bloco só usando (<maain> ou <div>) nesse caso vamos usar <main> por que é uma tag semântica. Outra coisa é colocar o h3 como h1 já que se trata do título principal da pagina. Se você notar, nem precisa adicionar nenhum div além da principal pra segurar o conteúdo (img, h1 e p).

    👋 Espero ter ajudado e continue no foco!

  • Felipe de Jesus Campos•70
    @felipejesus-front
    Posted almost 3 years ago

    Fala Cesar! blz? Muito legal seu código! Cara, tenho uma dica bem simples, porém muito importante pra te dar. Sua pagina começa a quebrar quando fica abaixo do tamanho do container com classe "principal", nela vc esta usando um "width: 300px", quando vc define um width ele vai seguir esse width até o fim do mundo, pelo componente ser pequeno acaba passando despercebido, porém num componente maior você veria isso com mais facilidade. Aconselho, sempre que possível usar "max-width" ao invés de width, pois como vc está definindo uma "largura máxima" o seu componente sempre vai ser mais responsivo conforme a tela diminui.

    Outra coisa importante no html é a semântica das tags. As tags html tem seus significados, normalmente interpretado por motores de busca como o google, ou por softwares de leitura de tela, usado por deficientes visuais, então usar as tags corretas ajuda demais na acessibilidade do seu codigo, fazendo por exemplo que seu site/conteudo seja encontrado pelo google mais facilmente.

    como corrigir isso? No seu conteúdo principal, ao invés de usar uma div, tente usar a tag <main>, pois ela indica que aquele é seu conteúdo principal nesta pagina.

    Colocar o titulo da pagina em um <h1> também ajuda nisso.

    Vou deixar um link para o caso de você querer entender melhor sobre isso: https://www.devmedia.com.br/html-semantico-conheca-os-elementos-semanticos-da-html5/38065

    lembre-se não é preciso gravar tudo isso, só entender já basta, na hora de codar, quando esquecer é só pesquisar no google que ta de boa! abração, meu mano! tbm estou iniciando! então tenhamos um bom aprendizado!

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
Frontend Mentor logo

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

Oops! 😬

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

Log in with GitHub