@correlucas
Posted
👾Hi Jorge Orquera, congratulations for your first solution!👋 Welcome to the Frontend Mentor Coding Community!
I saw your preview site and I liked a lot the work you’ve done here, it's almost complete, I’ve some suggestions you can consider applying to your code:
Your component is okay but its missing the vertical alignment. The best way to do it is by using flexbox
. First step is to add min-height: 100vh
to make the body height size becomes 100% of the screen height, this way you make sure that whatever the situation the child element (the container) align the body and then use the flex properties for alignment with display: flex
/ align-items: center;
/ justify-content: center;
body {
min-height: 100vh;
background: hsl(212deg, 45%, 89%);
font-family: "Outfit", sans-serif;
text-align: center;
display: flex;
align-items: center;
justify-content: center;
flex-direction: column;
}
The html structure is fine and works, but you can reduce at least 20% of your code cleaning the unnecessary elements, you start cleaning it by removing some unnecessary <div>
. For this solution you wrap everything inside a single block of content using <div>
or <main>
(better option for accessibility) and put inside the whole content <img>
/ <h1>
and <p>
.
<body>
<main>
<img src="./images/image-qr-code.png" alt="Qr Code Image" >
<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>
✌️ I hope this helps you and happy coding!
Marked as helpful