S
S
Senseich2017-08-22 15:46:32
css
Senseich, 2017-08-22 15:46:32

Flex-box items shrink even with a given width. Is this normal behavior?

Started learning flex-box. Tell me, it's normal when the elements have a width, but when the screen is reduced, the blocks are still compressed. Is this how flexes should be? If so, how to make the flex not shrink, but jump to the next line? Here is an example where I saw it: https://jsfiddle.net/api/post/library/pure/

Answer the question

In order to leave comments, you need to log in

4 answer(s)
I
Ivan Minakov, 2017-08-22
@Hardwit

In order to jump, you need to add the propertyflex-wrap: wrap;

A
Amir Alimzhanov, 2017-12-12
@Amirez

Yes, this is normal behavior for flex items. To transfer flex-wrap, as mentioned above (almost the same as white-space). min-width to help you. Read what flex-basis, flex-grow and flex-shrink are for (useful if you're making a sticky footer)

S
sewaca, 2021-07-16
@sewaca

flex-shrink: 0; and no min-width is needed anymore

M
Mikhail Derkach, 2017-09-14
@skeevy

html5.by/blog/flexbox - here is a detailed description, and attention is paid to flex-wrap, as written above

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question