Design comparison
Solution retrospective
I think my script.js can be smaller, any suggestions welcome.(its my first js ever) Also thank you for any critique to my code.
Community feedback
- @DavidMorgadePosted over 2 years ago
Hi, congratulations on finishing the challenge!
In this project, you choose to add the hover effect throw Javascript, but you can just use the CSS pseudoelement
:hover
, it will make your JS more clean and it's always better to use CSS everytime you can instead of JS because it will lower the project load times and it will increase the performance, for example, you can do something like this in your CSS:.rating__btn:hover { /* styles on hovering */ }
Also instead of
divs
for the buttons you can usebutton
orinput
, they are designed by that!, and you can remove all the default styles of those elements using the propertyall: unset
on your .rating__btn class.Hope my answer helps you!
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