M
M
Maxim Akhmerov2018-09-26 09:20:57
Flexbox
Maxim Akhmerov, 2018-09-26 09:20:57

What properties are needed for blocks in flexbox?

There are block requirements:
max-width: 300px;
min-width: 200px
What properties need to be set for the blocks to make it work like this:
so that when blocks of 300px do not fit into a line, they decrease to 200, and then 1 block flies out and blocks in the line are again 300px each

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
Maxim Akhmerov, 2018-09-26
@Maksum70

Found the answer:
.container {
display:flex;
flex-wrap:wrap;
}
.block {
flex-grow: 1;
flex: 1 0 200px;// and you need to write the stretching exactly like this, and not separately flex grow and min-width, otherwise
max-width: 300px will not work;
margin: 10px
}

V
Vladislav Lyskov, 2018-09-26
@Vlatqa

div{
display:flex;
flex-wrap:wrap;
}
div > div
{
max-width: 300px;
min-width: 200px;
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question