@correlucas
Posted
๐พHi @100-rab, congratulations on your 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.Keep the image responsive
. To manage the image size, you donโt need to define the width
and height
together, if you do it with different values this will make the image lose proportions, to keep the image responsive and respect the container size use img { display: block; max-width: 100%}
this way the image resize with the container whatever its size.
2.Clean your code by removing some unnecessary divs, most of the content can stand alone without a div. Use div only for blocks that need a special alignment or the content needs a special positioning.
3.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
4.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!
Marked as helpful
@100-rab
Posted
@correlucas I will try to avoid unnecessary divs next time and will try to make my code clean, thanks for your valuable feedback :)
PS Your solution was awesome :0 I will try to make a similar qr code like yours after learning js :)
@correlucas
Posted
@100-rab I don't know JS yet, I used this tutorial to apply the effect https://www.youtube.com/watch?v=9LZGB3OLXNQ
Have a nice day bro!
Marked as helpful
@100-rab
Posted
@correlucas Thank you soo much for the tutorial :)