Design comparison
Solution retrospective
Got stuck on spacing for the section with the music logo + annual plan + change button. I had brute forced it by simply adding margin-left to the change button to shift the Annual plan section to the left.
What would have been a good way to approach this section?
Community feedback
- @danielmrz-devPosted 11 months ago
Hey, @eosook!
Your project looks nice!
About the section with the price, music logo and change button, I'm gonaa tell you how I've done it:
- I created a
flex container
with 3flex items
.
- Item 1 is the music logo;
- Item 2 is
anual plan
+price
; - Item 3 is the
change button
;
I organized the
flex container
usingjustify-content: space-between
and gave the item 2 amargin-right: auto;
.That pretty much solved the problem for me. Very simple.
I hope it helps you too!
Great job on this project!
Marked as helpful1 - I created a
- @Zy8712Posted 11 months ago
Your site looks pretty good. I feel ike another way you could've done the spacing in the annual plan box is by using
display: flex
and thenjustify-content: space-between
. This would require you to modify your html a bit as well. So that the spacing is between two items, your change text and the stuff on the left hand side fo the box. So changing your html, it could look something like:<div class="order__summary-plan"> <div> <img src="images/icon-music.svg" alt="icon-music" id="music-logo"/> <div class="order__summary-plan-info"> <h2>Annual Plan</h2> <p>$59.99/year</p> </div> </div> <a href="" class="order__summary-plan-change">Change</a> </div>
Hope this somewhat 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