Answer the question
In order to leave comments, you need to log in
How to distribute blocks in a flex container?
Good afternoon!
It is necessary to distribute 3 blocks in flexbox: the
first and third in size, the middle one occupies all the remaining space
Between the blocks, the indent specified in pixels!
help
Answer the question
In order to leave comments, you need to log in
Add flex-grow: 1 to the middle, flex-grow: 0 to the rest (or don't set, default is 0)
.box {
flex: 0 0 auto;
}
.box:nth-child(2) {
flex: 1 1 0%;
}
.box + .box {
margin-left: 1rem;
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question