Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found

Submitted

Interactive rating component

@Olumide2596

Desktop design screenshot for the Interactive rating component coding challenge

This is a solution for...

  • HTML
  • CSS
  • JS
1newbie
View challenge

Design comparison


SolutionDesign

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

@pradeeps4ini

Posted

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, use max-width: 400px. And remove width: 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 helpful

0

@Olumide2596

Posted

@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

@pradeeps4ini

Posted

@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

@Olumide2596

Posted

Thanks a lot, I will work on it using your feedback

0

Please log in to post a comment

Log in with GitHub
Discord logo

Join 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