Flexbox Flashcards

1
Q

How do we turn an element into a flexbox container?

A

We set its display property to flex.

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

What is the default direction for a flex container?

A

The default direction is row.

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

How do we change the direction of our flexbox?

A

flex-direction: value

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

What is the default width for the direct children of a flexbox container?

A

Direct children will attempt to be as small as they can be to contain their content.

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

What is the element with display: flex; called

A

It is called the flex container

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

What are the direct children of a flex container called?

A

They are called flex items

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

Can flex items overflow their flex container?

A

Yes, if there is not enough space to hold the flex items, they will overflow their flex container and will cause a horizontal scroll.

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

What is the default behavior for flex-wrap in a flex container?

A

The default is flex-wrap: nowrap;

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

How can we increase the space between flex-items?

A

We can use gap.

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

How could we use a combinator to increase space between flex items?

A

We could use the adjacent sibling combinator and select our flex items.

.col + .col

and then introduce a margin-left: declaration to space them

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

How tall will flexbox items become by default.

A

Flexbox items will stretch along the row to equal the height of the tallest column content.

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

How could we prevent an image from stretching when we place it in a flexbox row?

A

Would could set the align-self property to flex-start

align-self: flex-start;

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

What justify property is available to use in Flexbox?

A

Flexbox uses the justify-content property on the flex-container.

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

What does the justify-content property control in flexbox?

A

The justify-content property controls how flex items are spaced along the main axis.

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

Can we set widths to flex items?

A

Yes, although we should:

  • set them in percentages
  • have the total percentages equal < 100%
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Where do we use align-self in flexbox?

A

We use align-self on a flexbox item that we want to specifically control the position of on the cross-axis.

17
Q

If we have divs inside of a flex container, and content within those divs, what elements are the flex-items?

A

The outer div would be considered the flex-items in this case, the content would not be affected by flex properties themselves