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 Card

@Frogerall

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


Any feedback/suggestion regarding my javascript code is very much appreciated Thanks 🙌👍💕

Community feedback

JibbyCodes 290

@Kijimai

Posted

Overall the rating component works wonderfully. If you do want to center the component on the page, you can set a parent container as the flex parent with

.flex_parent {
  display: flex;
  justify-content: center;
  align-items: center;
}

in this case, you could set the body element as the flex parent since this is an isolated project that only houses one component. On the other hand, you could set a dedicated parent container like a <div> as the flex parent and set it to this:

.some_flex_parent {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
}

setting the min-height of this parent element to 100vh ensures that it takes up the entire vertical width of the page to center the component properly.

As for your script, it's best practice to use const rather than let to store variables that you do not want changed.

Overall, nice work!

Marked as helpful

1

@momorocks111

Posted

In the html, instead of using a div tag for the container, you could use an article tag or section tag, it would make it better for the compiler. Hope this helps :)

Marked as helpful

1

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