I'm using column-count: 3
to divide a list into three columns and styles each list item with display: inline-block
to keep the list item´s children in the same column. The children are hidden with max-height
and overflow: hidden
.
I want to expand and show the children on click by setting max-height: none
, but since column-count tries to evenly balance all columns dynamically the list gets reordered. I understand that's what column-count is for.
I would like to use something similar to column-count: 3
but "lock" it after page load so it doesn't reorder when expanding children. Would that be possible without splitting the items into three different lists? The only requirement is that it works on IE11.
Here is my codepen demo to illustrate the problem.