Flexbox layout - multiple lines if long enough

I have this layout with flexbox:

Flexbox required layout

However, when the content in one of the columns of the first row grows, I do not get what I want. This following image explains what I get and what I want:

enter image description here

Basically, I want field 3 to span multiple lines, if necessary, without changing the position of box4

Please help me with this. Thanks

+4
source share
3 answers

This item is not possible with Flexbox . You should use the many jQuery plugins available.

You can check it after jQuery plugins.

1.) Packery .

2.) MCPants.

3.) Gridster.

4.) Masonry.

, , . .
, .

0

Flexbox . . , , , , , . , .

-1

Flexbox , , .

, , :

enter image description here

  • 2 , inline-block. ( ) 75%, - 25%.
  • flexbox. , .
  • , , .

, , 1 2 flex: 1 flex: 2, , 1 25% . 25% .


CSS: https://jsfiddle.net/Paf_Sebastien/dyxtq144/

-1

Source: https://habr.com/ru/post/1610360/


All Articles