Interactive rating component - css grid
Design comparison
Community feedback
- @correlucasPosted about 2 years ago
๐พHello @kirawesh, congratulations on your first solution!๐ Welcome to the Frontend Mentor Coding Community!
You did a good job here putting everything together. Iโve some suggestions for you:
1.To maintain the card responsive use
max-width
instead ofwidth
this way you allow the content to be flexible. The difference betweenmax-width
andwidth
is thatwidth
is fixed andmax-width
has a maximum size but can shrink to fit the content.2.Clean your code by removing some unnecessary divs, most of the content can stand alone without a div. Use div only for blocks that need a special alignment or the content needs a special positioning.
3.Add a margin of around
margin: 20px
to avoid the card touching the screen edges while it scales down.โ๏ธ I hope this helps you and happy coding!
Marked as helpful1@kiraweshPosted about 2 years agoThank you @correlucas for your helpful feedback!
-
I see, fixed that. But how to keep the gap between the rating buttons in mobile view? They disappear when I'm shrink the card.
-
I would love to see what clean code looks like, to understand how not to add unnecessary things as you said.
-
Fixed that.
Thank you so much :)
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