Flexbox Flashcards

1
Q

What is flexbox?

A

It is a group of items in a row or column.
display: flex; or display: inline-flex;

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

How do you set the flexbox to go down?

A

flex-direction: column;

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

Container or child? What does it do and how do you use it?
flex-direction?

A

Container. flex-direction: row;
There are also column, row-reverse, column-reverse

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

Container or child? What does it do and how do you use it?
flex-basis?

A

Container. It sets the size of each item in the flexbox.
flex-basis: 100px;

It is linked to the flex-direction. If -row then flex-basis is the width, If -column then flex-basis is the height.

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

What is justify-content? What are it’s values?

A

justify-content determines how the “boxes” appear in the container they are in.

JC’s safe values are flex-start, flex-end, center.

Other values like space-between are not used in all browsers

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

Container or child? What does it do and how do you use it?
flex-wrap:

A

Container. It allows boxes to wrap to the next line when the screen gets too narrow.
nowrap is default, wrap will wrap

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

Container or child? What does it do and how do you use it?
order:

A

Child. You can move the boxes around on the screen. lowest order number to the left.

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

Container or child? What does it do and how do you use it?
justify-content:

A

Container. flex-start is default and starts at the left edge and goes along the main-axis.
flex-end will start at the right side of the page.
center will center the boxes.

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

Container or child? What does it do and how do you use it?
align-items

A

Container. This aligns the items along the cross axis. ie.. if flex-direction is row, align-items goes from top to bottom.

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

In “height: 70vh;” what does vh stand for and why would you use it?

A

viewport height. it is the size of the container along the cross axis.

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

Container or child? What does it do and how do you use it?
align-self

A

Child.

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

Container or child? What does it do and how do you use it?
align-content

A

Container. This only works when flex-wrap is set to wrap.

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

Container or child? What does it do and how do you use it?
flex-grow and flex-shrink

A

Container. default, shrink is on and grow is off.
flex-shrink: 1;

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