Design comparison
Solution retrospective
Any feedback/suggestion regarding my javascript code is very much appreciated Thanks 🙌👍💕
Community feedback
- @KijimaiPosted 12 months ago
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 helpful1 - @momorocks111Posted 12 months ago
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 helpful1
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