CSS Flexbox Flashcards

1
Q

display: flex

A

Adding this to an element turns it into a flex container.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

flex-direction

A

Used to align any children of that element into rows or columns.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

flex-direction options

A
  • Row
  • Column
  • Row-reverse
  • Column-reverse
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

justify-content:

A

A property used to align and space-out flex-items a certain way. It aligns flex items along the main axis.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

justify-content: flex-start;

A

aligns items to the start of the flex container. For a row, this pushes the items to the left of the container. For a column, this pushes the items to the top of the container. This is the default alignment if no justify-content is specified.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

justify-content: center;

A

aligns all the flex items to the center inside the flex container.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

justify-content: flex-end;

A

aligns items to the end of the flex container. For a row, this pushes the items to the right of the container. For a column, this pushes the items to the bottom of the container.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

justify-content: space-between;

A

aligns items to the center of the main axis, with extra space placed between the items. The first and last items are pushed to the very edge of the flex container. For example, in a row the first item is against the left side of the container, the last item is against the right side of the container, then the remaining space is distributed evenly among the other items.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

justify-content: space-around;

A

similar to space-between but the first and last items are not locked to the edges of the container, the space is distributed around all the items with a half space on either end of the flex container.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

justify-content: space-evenly;

A

Distributes space evenly between the flex items with a full space at either end of the flex container.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

align-items:

A

A proper that is similar to justify-content. However it aligns flex items via the cross -axis which is the opposite of the main axis that justify-content uses.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

align-items: flex-start;

A

aligns items to the start of the flex container. For rows, this aligns items to the top of the container. For columns, this aligns items to the left of the container.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

align-items: flex-end;

A

aligns items to the end of the flex container. For rows, this aligns items to the bottom of the container. For columns, this aligns items to the right of the container.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

align-items: center;

A

align items to the center. For rows, this vertically aligns items (equal space above and below the items). For columns, this horizontally aligns them (equal space to the left and right of items).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

align-items: stretch;

A

stretch the items to fill the flex container. For example, rows items are stretched to fill the flex container top-to-bottom. This is the default value if no align-items value is specified.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

align-items: baseline;

A

align items to their baselines. Baseline is a text concept, think of it as the line that the letters sit on.

17
Q

flex-wrap:

A

Tells CSS to wrap items. This means extra items move into a new row or column. The break point of where the wrapping happens depends on the size of the items and the size of the container.

18
Q

flex-wrap: nowrap;

A

Default setting for flex-wrap, doesn’t not wrap items.

19
Q

flex-wrap: wrap;

A

wraps items from left-to-right if they are in a row, or top-to-bottom if they are in a column.

20
Q

flex-wrap: wrap-reverse;

A

wraps items from right-to-left if they are in a row, or bottom-to-top if they are in a column.

21
Q

flex-shrink:

A

A property that allows flex items to shrink if the flex-container is too small.

22
Q

flex-shrink values

A

The flex-shrink property takes numbers as values. The higher the number, the more it will shrink compared to the other items in the container. For example, if one item has a flex-shrink value of 1 and the other has a flex-shrink value of 3, the one with the value of 3 will shrink three times as much as the other.

23
Q

flex-grow:

A

The opposite of the flex-shrink property. Flex-grow controls the size of items when the parent container expands.

24
Q

flex-basis

A

A property that specifies the initial size of the item before CSS makes adjustments with flex-shrink or flex-grow.

25
Q

flex:

A

A shortcut to set flex-grow, shrink, and basis all at once.

For example, flex: 1 0 10px; will set the item to flex-grow: 1;, flex-shrink: 0;, and flex-basis: 10px;.

26
Q

order:

A

Used to tell CSS the order of how flex items appear in the flex container.

27
Q

align-self:

A

A property that allows you to adjust each item’s alignment individually.
It accepts the same values as align-items, and will override any value set by it.