Heads up! To view this whole video, sign in with your Courses account or enroll in your free 7-day trial. Sign In Enroll
- Controlling the Direction of Flex Items 3:47
- Wrapping Flex Items 2:33
- Distributing Space Inside a Flex Container 5:55
- Changing the Order of Flex Items 5:32
- Wrapping Items and Distributing Space 3 objectives
- Growing Flex Items 3:42
- Smarter Layouts with flex-basis and flex 6:42
- Aligning Flex Items on the Cross Axis 3:43
- Growing and Aligning Flex Items 3 objectives
- Vertical and Horizontal Centering 4:14
- Flexbox Properties Review 6 questions

- 2x 2x
- 1.75x 1.75x
- 1.5x 1.5x
- 1.25x 1.25x
- 1.1x 1.1x
- 1x 1x
- 0.75x 0.75x
- 0.5x 0.5x
The justify-content property lets you control the position and alignment of flex container items on the main axis, as well as how much space is between flex items. Learn about how to manipulate flex spacing using `justify-content`, `justify-content: space-between`, and `margin: auto`.
Resources
Video review
- You apply the
justify-content
property to flex containers only. - The
justify-content
property lets you control the position and alignment of flex Items on the main axis and how space should be distributed in a flex container. - The default value for
justify-content
isflex-start
, which places items towards the start of each flex line. - To place items at the end of the flex line, set
justify-content
toflex-end
. - The value
center
places flex items in the center of the line, with equal amounts of empty space between the line's start edge and the first item, and between the end edge and the last item. - The value
space-between
displays equal spacing between flex items. - For equal spacing around every flex item, use the value
space-around
. - A margin set to
auto
will absorb any extra space around a flex item and push other flex items into different positions.
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up-
karan Badhwar
Web Development Techdegree Graduate 18,135 Points4 Answers
-
Victor Mercier
14,667 Points1 Answer
-
SeHyun Choi
3,441 Points2 Answers
-
Nour El-din El-helw
8,241 Points1 Answer
-
S Campos
413 Points3 Answers
-
Aakash Srivastav
Full Stack JavaScript Techdegree Student 11,638 Points2 Answers
-
Aakash Srivastav
Full Stack JavaScript Techdegree Student 11,638 Points2 Answers
-
Anne Donald
9,847 Points2 Answers
-
Eric Jusic
4,350 Points1 Answer
-
Ryan Schmelter
9,710 Points1 Answer
-
jlampstack
23,932 Points1 Answer
-
Arikaturika Tumojenko
8,897 Points2 Answers
-
Unsubscribed User
3,379 Points3 Answers
View all discussions for this video
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up
You need to sign up for Treehouse in order to download course files.
Sign upYou need to sign up for Treehouse in order to set up Workspace
Sign up