Y
Y
Young_smartphone2018-03-26 06:35:47
css
Young_smartphone, 2018-03-26 06:35:47

How to make flexbox behave like float?

5ab86a0ed6d31184440656.png
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

3 answer(s)
A
A person from Kazakhstan, 2018-03-26
@LenovoId

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

Y
Young_smartphone, 2018-03-26
@Young_smartphone

In general, margin-left: auto;

D
Dima Polos, 2018-03-26
@dimovich85

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 question

Ask a Question

731 491 924 answers to any question