"JavaScript Foundations" was retired on April 27, 2015. You are now viewing the recommended replacement.
Heads up! To view this whole video, sign in with your Courses account or enroll in your free 7-day trial. Sign In Enroll
Well done!
You have completed CSS Flexbox Layout!
You have completed CSS Flexbox Layout!
Now that you know the basic concepts and terminology, you're ready to learn the first step in creating a flexbox layout: defining the flex container.
Resources
- A Complete Guide to Flexbox
- A Visual Guide to CSS3 Flexbox Properties
- display | MDN
- Flexbox - latest browser support
Video review
- Before you can use any flexbox property, you need to define a flex container in your layout.
- You create a flex container by setting the
displayproperty of an element to one of the flexbox layout values:flexorinline-flex. - By default, flex items are laid out horizontally on the main axis from left to right.
- By default, flex items stretch to fill the flex container's height.
-
display: flex;creates a block-level flex container. -
display: inline-flex;creates an inline flex container. - Any element outside a flex container is not affected by the flexbox layout.
- Only children of a flex container automatically become flex items.
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign upRelated 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