Answer the question
In order to leave comments, you need to log in
How to make flexbox behave like float?
justify-content: space-between works within the same line, and when wrapped with flex-wrap: wrap, it moves both blocks to the beginning of the line. With float right/left everything works fine, but I want to take advantage of flexbox.
Maybe it's possible that during the transfer the block would start to occupy 100% of the parent's width?
Answer the question
In order to leave comments, you need to log in
no one forbids using float - they just use it exclusively for wrapping around elements;
earlier, all sorts of "dancing with a tambourine" were used for vertical alignment with flex, but it all became much easier ...
you can use wrapping inside flex
You can make it take 100% of the parent when it is moved, give it flex-grow: 1;
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question