Welcome to the Treehouse Community
The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.
Jordan C6,249 Points
Can you use "margin-right: auto;" on the name in the header to make it so the name and nav are against opposite edges?
This would be instead of "justify-content: space-between;"
Steven Parker210,863 Points
When using flexbox, always try to do things the "flexbox way".
If there are only two items, then since "
justify-content: space-between;" is intended to do exactly what you want, that would be the best-practice choice.
Using auto margins could be a good choice when you have multiple items to group together on opposite sides, but you may be able to achieve the same effect with combinations of "
justify-content" on the container and "
justify-self" on the items(s) to be aligned differently.
I agree with Steven Parker.