Design comparison
Solution retrospective
I don't really understand how to position the items in the summary section (how to make the 80/100 stick to the right etc.) so I solved it by using position relative but that created some problems when I was making this component responsive.
Community feedback
- @aaronrubinsteinPosted over 1 year ago
Hey Kmigel,
A trick to making a flex item "stick to the right" is to use
margin-left: auto
. That causes the item's left margin to expand to take up as much free space as possible, which pushes it all the way to the right.Taking a quick look at your code, here are a few suggestions:
- Wrap
your-points
andmax-points
in a new div (making them a single flex item within thesummary-item
container) and style that div withmargin-left: auto
- You should be able to remove
justify-content: center
fromsummary-item
(you want the flex items to be justified left, except for the last one that you push to the right) - Remove the absolute and relative positioning on all the items within the
summary-item
container. You shouldn't need that.
That should address the responsive issues. Hope that helps 👍
(here's my code for the summary item if you want to take a closer look at the css)
Aaron
Marked as helpful1 - Wrap
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