@correlucas
Posted
👾Hi @Simonify30, congratulations on your solution!
Great solution and a great start! From what I saw you’re on the right track. I’ve few suggestions for you that you can consider adding to your code:
1.Fix the alignment of the whole content using flex
and min-height
to manage the vertical alignment and make everything centered.First of all put min-height: 100vh
to the body
to make the body display 100% of the viewport height (this makes the container align to the height size that's now 100% of the screen height) size and display: flex
e flex-direction: column
to align the child element (the container) vertically using the body as reference.
body {
min-height: 100vh;
background-color: hsl(212, 45%, 89%);
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
2.Use relative units like rem or em
instead of px
to have a better performance when your page content resizes on different screens and devices. REM
and EM
does not just apply to font size, but all sizes as well. To save your time you can code your whole page using px
and then in the end use a VsCode plugin called px to rem
to do the automatic conversion or use this website https://pixelsconverter.com/px-to-rem
3.Reduce your code by removing unnecessary elements. The HTML structure is working but you can reduce at least 20% of your code by 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 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>
Here's my solution for this challenge if you wants to see how I build it: https://www.frontendmentor.io/solutions/qr-code-component-vanilla-cs-js-darklight-mode-nS2aOYYsJR
✌️ I hope this helps you and happy coding!
@Simonify30
Posted
@correlucas thanks for the corrections i have worked on it, pls check again and give me feedback
@correlucas
Posted
@Simonify30 Ok, I happy to hear that say me if was useful and worked for you. Keep it up