responsive qr-code-component-main using css flex
Design comparison
Solution retrospective
I would like to know if my code for this project could be cleaner
Community feedback
- @correlucasPosted about 2 years ago
πΎHi @matheusmorenocf, 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.Replace the
<h2>
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.2.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">
3.Add the box shadow to stylize the card:
box-shadow: 5px 5px 15px 5px rgb(0 0 0 / 3%);
4.Add a margin of around
margin: 20px
to avoid the card touching the screen edges while it scales down.5.Use relative units as
rem
orem
instead ofpx
to improve your performance by resizing fonts between different screens and devices. These units are better to make your website more accessible. REM does not just apply to font size, but to all sizes as well.βοΈ I hope this helps you and happy coding!
0 - @faha1999Posted about 2 years ago
Hello, Matheus Moreno Congratulations on finishing this project. It's lovely and great on the whole! Just a little tip:
- You might want to use semantic tags like the
<main>
to wrap your code, instead ofdiv
. like
<main> <div class="container-card"></div> <div class="attribution"></div> </main>
This would help improve accessibility.
-
Instead of using
px
, use relative units likerem or em
to get better performance when the information on your page needs to be resized for multiple screens and devices.REM
andEM
apply to all sizes, not justfont-size
. You can code your entire page inpx
and then, at the very end, use the VsCode pluginpx to rem
to perform the automatic conversion px to rem -
add
min-height: 100vh;
to thebody
I hope it will work. Happy coding.
0 - You might want to use semantic tags like the
- @VCaramesPosted about 2 years ago
Hey @matheusmorenocf, great job on this project!
Some suggestions to improve you code:
-
For accessibility purposes, itβs best to use rem/em instead of px for your CSS property values.
-
To make your content fully responsive, change your
height
tomin-height
in your <body> element>.
Happy Coding!
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