FlexBox Flashcards
How do you initiate flexbox?
Display: flex
Make containers within main container into columns or rows?
flex-direction: row
flex-direction: row-reverse
flex-direction: column
flex-direction: column-reverse
Describe the flex-box axes.
Main = x Cross = y
What does justify content do?
Distributes content across main axis. Imagine boxes distributed horizontally
|■ ■ ■ ■|
Default justify content distribution?
justify-content: flex-start
|■ ■ ■ |
Name 6 justify-content properties
justify-content:
a) flex-start
b) flex-end
c) center
d) space-between
e) space-around
f) space-evenly
Describe this justify content:
|■ ■ ■ |
justify-content: flex-start
Describe this justify content:
| ■ ■ ■|
justify-content: flex-end
Describe this justify content:
| ■ ■ ■ |
justify-content: center
Describe this justify content:
|■ ■ ■|
justify-content: space-between
Describe this justify content:
| ■ ■ ■ |
justify-content: space-around
left & right only have half as much space
Describe this justify content:
| ■ ■ ■ |
justify-content: space-evenly
What are the first 3 flexbox properties to initialize your design?
- Display: flex;
- flex-direction: row;
- Set size of child elements and parent elements
- justify-content: space-evenly,
What does flex-wrap do?
Determines if elements will wrap along main axis onto a new line (if horizontal) or new column (if vertical)
What is the default flex-wrap property value
flex-wrap: nowrap
Describe
flex-wrap: nowrap
_ ■ ■ ■ ■ ■ _
Describe
flex-wrap: wrap
from: _ ■ ■ ■ ■ ■ _
_
■ ■ ■
■ ■
_
Describe
flex-wrap: wrap-reverse
If you had a column of containers, it’ll make it so that the containers fill on the right side first, then remaining columns wrap to the middle.
If you had a row of containers, it’ll make it so that the containers fill on the bottom and then wrap to the middle
Name the first 4 flex properties
- Display: flex
- Flex-direction: row, row-reverse, column, column-reverse
- Set size of child elements and parent element
- Justify content: flex-start, flex-end, center, space-between, space-around, space-evenly - SET DISTRIBUTION OF YOUR WRAP
- flex-wrap: nowrap (decide if you want contents to wrap)
Describe Align-Items
Align items for distributing content along the cross axis [y]. Similar to justify-content which is to distribute along main axis [x].
Name different align-item property values
- flex-start (top if row, side if column)
- flex-end
- center
- baseline (aligns bottom of content)
Describe align-content
distribute space along cross axis [y] but only when we have multiple rows or columns
align-content: flex-start:
__________
■ ■ ■
■ ■
__________
Name align-content property values
flex-start
space-between
flex-end
flex-center
Describe align-self
Changing the alignment of one container in a set of containers
■ ■ ■ ■ ■
■