Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialLearning Coding
7,134 PointsQuestion about Centering
why is it important to use both of these together ?
- justify-content: center;
- align-items: center
Does it make to use either justify-content or align-items?
2 Answers
Christopher Debove
Courses Plus Student 18,373 PointsMore specifically :
justify-content is for the main-axis ( horizontally if flex-direction: row, and vertically if flex-direction: column)
align-items is for the cross-axis ( vertically if flex-direction: row, and horizontally if flex-direction: column)
Hope i could help you.
Philip Gales
15,193 PointsOne aligns the items horizontally, the other vertically.
Here is a great explanation on stackoverflow.
This website shows a more practical answer http://www.sketchingwithcss.com/samplechapter/cheatsheet.html