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

Submitted

Componente QR Code responsivo

@adrianneclp

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


How can I make the component better centered on the page? How can I make the code cleaner?

Community feedback

Fer 3,970

@fernandolapaz

Posted

Hi 👋, perhaps some of these tips may interest you:

HTML 🧱, ACCESSIBILITY ⚖:

  • The main content of every page (the card in this case) should be wrapped with the <main> tag.
  • Every page should have an <h1> to improve user experience and because it is an important element when it comes to SEO. Maybe the 'texto1'...

CSS 🎨:

  • The page content could be centered using Grid or Flexbox. This may be the easiest way:
body {
min-height: 100vh;
display: grid;
place-content: center;
}

And I think you could remove the '.container' .

  • And you might consider using some CSS reset as a good practice at the start of each project, to have a clean starting point and reduce differences between browsers. For example, these are some very common and useful ones:
*,
*::before,
*::after {
box-sizing: border-box;
margin: 0;
padding: 0;
}

(this will remove the horizontal scrollbar you have, for example)

I hope you find it useful, any questions do not hesitate 🙂

Regards,

2

@jarleisassi

Posted

Para centralizar podes fazer o seguinte:

body {
width: 100vw;
height: 100vh;
display: flex;
align-items: center;
justify-content: center;
flex-direction: column;
}


.container {
width: 100vw;
min-height: 80vh;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}

e a parte do html podes por a div class "attribution" toda dentro da div "container" entao fica o container pai da div com a classe"qrcode" e a div com a classe "attribution"

2

@jarleisassi

Posted

Sugiro tambem voce resetar o css antes de tudo. Esse site aqui ja te da tudo pronto. E' so copiar e colar no inicio do seu estilo css https://meyerweb.com/eric/tools/css/reset/

1

@adrianneclp

Posted

Obrigada pelas sugestões!@jarleisassi

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