@MelvinAguilar
Posted
Hi there 👋. Good job on completing the challenge ! I have some feedback for you if you want to improve your code.
As mentioned, you should use grid or flexbox to center it. The main problem I see is that you have taken your body as a component, not the whole screen. In fact, the body should occupy 100% of the width and height of the screen.
body {
/* background: var(--WHITE); */
background: var(--LIGHT-GRAY);
/* border-radius: 20px; */
/* margin: 15rem auto; */
/* max-width: 350px; */
text-align: center;
min-height: 100vh;
display: grid;
place-items: center;
}
.container {
padding: 1em;
max-width: 320px;
background: var(--WHITE);
}
HTML:
- Instead of having many <span> elements you should have occupied a single element and it can be for example a paragraph:
<p>Scan the QR code to visit Frontend Mentor and take your coding skills to the next level</p>
- Use the
<main>
tag to wrap all the main content of the page instead of the<div>
tag. With this semantic element you can improve the accessibility of your page.
- You must use a level-one heading (h1) even though this is not a full-page challenge. You can create an '<h1>' element within your 'main' element that will be hidden visually but visible and readable by screen readers. The class "sr-only" hides content visually and here are the styles to copy. e.g.:
<h1 class="sr-only">QR Card Component</h1>
- The
alt
attribute should explain the purpose of the image. Uppon scanning the QR code, the user will be redirected to the frontendmentor.io website, so a betteralt
attribute would beQR code to frontendmentor.io
If you want to learn more about the alt
attribute, you can read this article.
I hope you find it useful! 😄 Above all, the solution you submitted is great!
Happy coding!