Design comparison
Solution retrospective
I struggled mostly with the CSS.
Community feedback
- @denieldenPosted about 2 years ago
Hi Gurv, 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 - add descriptive text in the
alt
attribute of the images - remove all
margin
from.container
class because with flex they are superfluous - use
justify-content: center
to the body to center the card horizontally - instead of using
px
use relative units of measurement likerem
-> read here
Hope this help! Happy coding π
Marked as helpful0 - add
- @correlucasPosted about 2 years ago
πΎHi @gsparmar, 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:
Replace the
<h3>
containing the main title with<h1>
note that this title is the main heading for this page and every page needs one h1 to show which is the most important heading. Use the sequence h1 h2 h3 h4 h5 to show the hierarchy of your titles in the level of importance, never jump a level.Add the
alt text
to improve accessibility.The alt attribute provides alternative information for an image if a user for some reason cannot view it (because of a slow connection, an error in the src attribute, or if the user uses a screen reader). ---><img src="./images/image-qr-code.png" alt="QR Code Frontend Mentor">
Use
<main>
instead of a simple<div>
this way you improve the semantics and accessibility showing which is the main block of content on this page. Remember that every page should have a<main>
block and that<div>
doesn't have any semantic meaning.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/
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!
0 - @nzewiPosted about 2 years ago
Congrats on completing this challenge Gurv
You did great on this challenge. Your CSS is very good.
Here are my suggestions:
1.Using relative units like
rem
andem
instead ofpx
for your spacing and font-size would make your site more responsive. Learn about them and use them in your next project.2.Ensure that all content on your page is contained within a landmark region, e.g Wrapping your card
<div>
inside a<main>
tag. This makes your HTML more semantic.3.Pay close attention to the design and put more effort into trying to replicate it. You can make the font-size of your card heading larger.
I hope this helps
0
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