Design comparison
Solution retrospective
Feedback and any tips on how to improve my code are highly appreciated. Also, I'm having the challenge of unchecking a previous rating if I choose another. Thank you😁.
Community feedback
- @pradeeps4iniPosted over 2 years ago
Hi, @Olumide2596. How are you?
You did an awesome job at implementing the design.
To learn how to uncheck the previous rating, you can read this little demo code i wrote. Play with it, modify it and if you don't understand someting. Feel free to reach me. https://codepen.io/pradeeps4ini/pen/OJvZGev
Some suggestions to improve the code:
-
You should use <main> element only to wrap the main content of the page. You should keep the attribution content in a <footer> element and out of the <main> element. These are semantic elements and used to structure the page. You can read more about them here...https://www.freecodecamp.org/news/semantic-html5-elements/.
-
Instead of using
min-width: 400px
, usemax-width: 400px
. And removewidth: 50%
, you won't need it, with max-width: 400px. This will make your container more responsive. -
In the ratings section, we are interacting with the rating elements. Therefore you should use either <buttons> or <input type="radio">. I prefer <input type="radio">. This is much better for accessibility and readability. Read the page i linked above about semantic elements. You'd get a better understanding of how and for what purpose to use an element.
Marked as helpful0@Olumide2596Posted over 2 years ago@pradeeps4ini Thanks for your feedback, I have made improvements to my code. I wasn't getting the unchecked previous rating from your code pen. But, I've been able to come up with something by using
:focus
on the CSS. I'll appreciate further feedback on what I can improve on.1@pradeeps4iniPosted over 2 years ago@Olumide2596 You solution looks good. And using focus to style is a good idea. Thanks for teaching me this.
Have fun and keep doing more projects.:)
0 -
- @Olumide2596Posted over 2 years ago
Thanks a lot, I will work on it using your feedback
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