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 using html,css, and JS

merii 80

@merii-crl

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


I would love to hear your feedbacks If you have one, Thanks!

Community feedback

@0xabdulkhaliq

Posted

Hello there 👋. Congratulations on successfully completing the challenge! 🎉

  • I have other recommendations regarding your code that I believe will be of great interest to you.

CSS 🎨:

  • Looks like the component has not been centered properly. So let me explain, How you can easily center the component without using translate.
  • We don't need to use translate to center the component both horizontally & vertically. Because using margin or padding will not dynamical centers our component at all states
  • You already using Flexbox for layout, but you didn't utilized it's full potential. Just add this single following rule to properly center the component.
body {
min-height: 100vh;
}
  • Now remove these styles, after removing you can able to see the changes
body {
transform: translate(0, 150px);
}
  • Now your component has been properly centered

.

I hope you find this helpful 😄 Above all, the solution you submitted is great !

Happy coding!

Marked as helpful

0

@Kamlesh0007

Posted

Congratulations on completing the challenge! That's a great achievement, and I'm sure you put a lot of effort into it. I really liked the way you approached the challenge and the code you wrote. You demonstrated a good understanding of the concepts and applied them effectively to solve the problem.I have a few suggestions to improve your code further. To make the container centered using a better approach, you can indeed use the min-height: 100vh property on the body tag. This will ensure that the container occupies at least the full height of the viewport.

body {
color: hsl(216, 12%, 54%);
font-family: 'Overpass', sans-serif;
font-weight: 400;
font-size: 15px;
line-height: 1;
display: flex;
flex-direction: column;
min-height: 100vh; // add this line
justify-content: center;
align-items: center;
/* transform: translate(0, 150px); */ remove this
}

Marked as helpful

0
Ana 70

@akajfes

Posted

Hello! Looks really well done :) I would just say that when doing your html, you have a <p> with a class of "heading". It would be better if that was an actual h1 instead, as when you do HTML validation, it will ding you for not having a section with a heading element. I recommend using something like https://validator.w3.org/nu/ in order to check to make sure your HTML is valid! Other than that, good job :D

Marked as helpful

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