Design comparison
Solution retrospective
Does my spacing look ok?
I had to use negative margin to get a certain 2 items to line up properly. Can anyone advise a better way to achieve this?
Thank you for your consideration and support.
Community feedback
- @0xabdulkhaliqPosted over 1 year ago
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.
BACKGROUND iMAGE 📸:
- Looks like the background svg has not been properly set yet, So let me share my css snippet which helps you to easily apply the
background color
with thebackground svg
they provided to place perfectly as same as design.
- Add the following style rule to your css, and then experience the changes
body { background: url(./images/pattern-background-desktop.svg) no-repeat, #E1E9Ff; background-size: contain; }
- Tip, Don't forget to generate a new screenshot after editing the
css
file
.
I hope you find this helpful 😄 Above all, the solution you submitted is great !
Happy coding!
Marked as helpful2 - @CarlHummPosted over 1 year ago
Hi
Negative Margins
You have a
.sub-plan-container
withjustify-content: space-evenly
. Inside this container you're trying to space items unevenly using negative margins. Instead, what we can do is set the flex-container tojustify-content: flex-start
and then applymargin-left: auto
to the change link. This will place flex items towards the start and place the change link at the end, taking up the remaining space.Other than the margins
There are a few things you can do to make it look more like the design :
- Align annual price text with the price. You can do this by setting
text-align: left
on your.plan
class. - Set width for .sub-plan-container, apply gap or margin between music icon and .plan, and style .sub-plan-containers background colour.
- Reduce font-weight for your paragraph and cancel button so it's less bold.
- Consider replacing
margin: 0 2rem
declarations with a single padding declaration on info element. - Change font size on HTML element to be relative to browser preferences (100%) and then adjust Rem and Em sizing accordingly.
Marked as helpful1 - Align annual price text with the price. You can do this by setting
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