D
D
Damir Sayahov2018-08-03 15:06:04
css
Damir Sayahov, 2018-08-03 15:06:04

How to hard wrap a flex element?

Good afternoon. I have a flex container with properties

display: flex;
align-items: center;
justify-content: space-between;
flex-wrap: wrap;

It contains 5 elements. Each has different content.
How to make it so that at a certain resolution only 2 elements remain on the first line, and the rest go to the next line?
In the example, some content blocks have a fixed size, but in practice this is not the case. The block size is determined by its content.
In the sandbox https://codepen.io/anon/pen/oMyxRG?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
O
Orbb, 2018-08-03
@humiliation

different flex behavior depending on screen resolution, different parent width per media . In bootstrap 4, this is well implemented by classes:
https://getbootstrap.com/docs/4.0/utilities/flex/

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question