Design comparison
Solution retrospective
are there any mistakes or any redundant stuff in my code?? if there are, what should I do instead? is there a best solution for this challenge?
Community feedback
- @correlucasPosted about 2 years ago
πΎHi @kelvin-0, congratulations on your first solution!π Welcome to the Frontend Mentor Coding Community!
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.Something I've noticed in your code is that on many occasions you've added some
<div>
to wrap contents that don't really need to be inside of a div block. Note that for this challenge all you need is a single block to hold all the content, which can be<div>
or<main>
if you want to use a semantic tag to wrap the content, the cleanest structure for this challenge is made by a block of content with div/main and all the content inside of it (img, h1 and p) without need of any other div or something. See the structure below:<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>
2.Use a CSS reset to avoid all the problems you can have with the default CSS setup, removing all margins, and making the images easier to work, see the article below where you can copy and paste this CSS code cheatsheet: https://piccalil.li/blog/a-modern-css-reset/
βοΈ I hope this helps you and happy coding!
Marked as helpful1@kelvin-0Posted about 2 years ago@correlucas I appreciate you so much for even considering taking the time to review my code. I am looking forward to your next suggestions on my next challenge. love you lucas
0 - @nzewiPosted about 2 years ago
Congrats on completing your first challenge Kelvin
You have a great solution there
Here are my suggestions for you:
1.Use relative units like
rem
andem
instead ofpx
for spacing and font sizes, this would make your site more responsive. Learn about them and use them in your next project.2.Never forget to add the
alt
attribute to your image tag. All images must have alternate text to convey their purpose and meaning to screen reader users. It makes your site more accessible.3.In your
#container
styles, you do not need thewidth
property since you have usedmax-width
already.4.Ensure that all content on your page is contained within a landmark region, e.g Wrapping your
<div>
without a class inside a<main>
tag. This makes your HTML more semantic.I hope this helps
Marked as helpful1@kelvin-0Posted about 2 years ago@nzewi thanks a lot nelson for taking the time to review my code and provide some helpful tips, I will start implementing them as soon as I start my next challenge
0 - @denieldenPosted about 2 years ago
Hi Kelvin, congratulations on completing the challenge, great job! π
Some little tips for optimizing your code:
- add
main
tag and wrap the card for improve the Accessibility - also you can use
article
tag instead of a simplediv
to the container card for improve the Accessibility img
element must have analt
attribute, it's very important!- use
min-height: 100vh
instead ofheight
, otherwise the content is cut off when the browser height is less than the content - instead of using
px
use relative units of measurement likerem
-> read here
Hope this help! Happy coding π
Marked as helpful1@kelvin-0Posted about 2 years ago@denielden thank you so much deniel for spending the time reviewing my code and giving some helpful tips, I will start applying it as soon as I start the next challenge.
1@denieldenPosted about 2 years ago@kelvin-0 You are welcome and keep it up :)
1 - add
Please log in to post a comment
Log in with GitHubJoin 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