Design comparison
Solution retrospective
- maybe on this occasion I will ask how to use margins wisely. I'm still confused to determine when to use margins and when to use gaps in flex, or use justify-content:space-between, to give the spacing between elements
can anyone explain?
Community feedback
- @BiljanaKotevPosted almost 2 years ago
You want to use margins when you want space between difference sections. For example you could have added a bit of margin-top on your features section container flex so it's not so close to the other sections. Hope that helps.
1 - @FloratobyDevPosted almost 2 years ago
Generally, I use
gap
to separate elements that are inside the container. Then, usemargin
if I need to specifically add a margin to an element. You can usemargin
for each element but don't you think that's a little tedious? Forjustify-content: space-between
, I'd use it if I want to separate an element with flexibility in mind. A simple example would be separating the brand name from the tab container, like in this challenge. It's nice to use it in that situation since it will automatically figure out the spacing between them even if the viewport size changes.Hope that's a good enough explanation. Well done finishing the project mate.
1
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