Flexbox Flashcards
Which CSS property defines flex block container?
display: flex;
Which CSS property defines flex inline container?
display: inline-flex;
Which CSS property establishes the main-axis of the flex container?
flex-direction
Which axis defines the direction that flex items are placed in the flex container?
main-axis
How can you set the main-axis of flex container from left to right in ltr?
flex-direction: row;
How can you set the main-axis of flex container from top to bottom?
flex-direction: column;
How can you set the main-axis of flex container from bottom to top in reverse order?
flex-direction: column-reverse;
How can you set the main-axis of flex container from right to left in rtl?
flex-direction: row;
How can you set the main-axis of flex container from right to left in ltr?
flex-direction: row-reverse;
How can you set the main-axis of flex container from left to right in rtl?
flex-direction: row-reverse;
What is the default wrapping behaviour of flex container?
nowrap
Which CSS property changes the wrapping behaviour of flex container?
flex-wrap
What are the possible values of flex-wrap property?
nowrap | wrap | wrap-reverse
How can you tell flex container that you want flex items will wrap onto multiple lines, from top to bottom?
flex-wrap: wrap;
How can you tell flex container that you want flex items will wrap onto multiple lines, from bottom to top?
flex-wrap: wrap-reverse;
How can you tell flex container that flex items should not wrap?
flex-wrap: nowrap;
Shorthand for the ‘flex-direction’ and ‘flex-wrap’ properties.
flex-flow
Default values for ‘flex-flow’ property.
flex-flow: row nowrap;
Which property defines the alignment along the main axis of flex container?
justify-content
Default value for justify-content property of flex container.
justify-content: flex-start;
Pack the flex items toward the start of the flex-direction
justify-content: flex-start;
Pack the flex items toward the end of the flex-direction
justify-content: flex-end;
Center flex items along the main-axis
justify-content: center;
Distribute flex-items evenly along the main-axis; so that first item is on the start line, last item on the end line
justify-content: space-between;
Distribute flex-items along the main-axis, so that the spacing between any two items, and the space to the edges is equal.
justify-content: space-evenly;
Distribute flex-items along the main-axis, so that all the items have equal space on both sides.
justify-content: space-around;
Which CSS property defines the default behavior for how flex items are laid out along the cross axis?
align-items
Default value for align-items property of flexbox.
stretch
Place flex items at the start of the cross axis.
align-items: flex-start;
Place flex items at the end of the cross axis.
align-items: flex-end;
Center flex items in the cross-axis.
align-items: center;
Align flex items as their baselines.
align-items: baseline;
Which CSS property is used to manage the positioning of wrapped flex items?
align-content
Which property is used to align individual items of flex-container
align-self
What is the default order of flex items?
0
Which property is used to change the flex item order?
order
Which property triggers the ability for a flex item to grow if necessary.
flex-grow: #
What unit is used by flex-grow property?
It has no units, it defines a proportion. It dictates what amount of the available space inside the flex container the item should take up.
If all items have flex-grow set to 1, how will the remaining space in the container be distributed?
equally to all children.
opposite property of flex-grow
flex-shrink
which rule doesn’t allow items to shrink
flex-wrap: wrap;
What flex-shrink value establish
How fast the item will shrink, for example flex-shrink: 5 will shrink the item 5 times faster than flex-shrink: 1, 0 value do not shrink at all
What is the default flex-basis
auto
What flex-basis specifies?
actual length of the specific item depending on the flex-direction of the container
If the width and height of a specific flex item is defined, what is the behavior of flex-basis?
flex-basis overrides one of them depending on the flex-direction of the container.
What is teh shorthand property for all of the following properties: flex-grow, flex-shrink, flex-basis
flex; 0 1 auto
precise syntax is:
flex: none | [ ? || ]