How would you use space-between and what do you know about it?
Experience Level: Junior
Tags: CSSFlexbox
Answer
The space-between
is a value of the justify-content
property or the align-content
property.
The justify-content: space-between
makes the flex items to be equally distributed on the main axis in such a way they have the same amount of space between each of them and there is no space on the outer sides of the first and last flex item.
The align-content: space-between
makes the flex items to be equally distributed on the cross-axis in such a way they have the same amount of space between each of them and there is no space on the outer sides of the first and last flex item.
.container {
display: flex;
justify-content: space-between;
}
.container2 {
display: flex;
align-content: space-between;
}
Related Flexbox job interview questions
What is the CSS property align-items used for and what values can it have?
CSSFlexbox JuniorWhat is a cross axis in Flexbox?
CSSFlexbox JuniorWhy would you use flex-wrap CSS property and what values can it have?
CSSFlexbox JuniorWhen would you use flex-flow property and what is it good for?
CSSFlexbox JuniorHow does flex-flow property work and what are its advantages?
CSSFlexbox Junior