In my angular app, I'm using ui-sortable to sort an <ul>
.
The elements itself are resizable.
This is similar to the setup I have:
And I would like that "4" and "5" use the space on top of them:
Here is a fiddle. Please note that this is an oversimplified example, and that the elements are actually resizable by the user and sortable.
Libraries like masonry won't do because they use absolutely positioned elements, that will undo the way the ui-sortable works, the resize won't push the element's either.
So how can I achieve this?
- Have I understood correctly that this is not possible with a css only solution? That flexbox will get the height of the highest element and put that height to the "row".
- Is there any js solution that won't rely on
position: abolute
, or rather, that it will still let me sort? - What are my options without getting rid of the libraries I already have?
- What are my options getting rid of the libraries I already have?
display:flex
,flex-direction:column
and assign each child divflex:1 1 auto
. Set thewidth
andheight
of your container divs. – Oneidaoneil