I am currently in a situation where I need to do use multi-column layout mode of css.
Basically, I am creating a mega-menu where I need to have variable list items inside unordered list.
For that I need to have four columns and if content from list items are not far enough to fit within four columns, it should just stay within one column. That's why I need to have flexible height on multi-column container.
<ul class="megamenu-list">
<li>Item-1</li>
<li>Item-2</li>
<li>Item-3</li>
</ul>
and here is the css part.
.megamenu-list {
visibility: visible;
opacity: 1;
column-count: 4;
column-fill: auto;
height: 400px;
padding: 20px;
}
After some googling I come to know that to be able to use column-fill auto, one needs to have constrained(fixed) height on parent container which is not useful as there may be the case when there are only one or two list items within container.
I already tried that thing in my other question with flex but with no luck of getting any response.
Set flex container height to flex items content height when there are only fewer items
Now I found the below discussion at github which seems to be closed but don't know how.
https://github.com/w3c/csswg-drafts/issues/3064
Thanks.