0

Here is the list:

ul {
    display: flex;
    flex-flow: column wrap;
    position: absolute;
    list-style: none;
    max-height: 192px;
    padding: 5px;
    background: #090;
}

li {
    flex: 1 0 30px;
    min-width: 100px;
    margin: 1px;
    padding: 0 2px;
    background: rgba(255, 0, 0, 0.75);
    color: #fff;
    font-family: arial;
    line-height: 30px;
}
<ul>
    <li>Line 0</li>
    <li>Line 1</li>
    <li>Line 2</li>
    <li>Line 3</li>
    <li>Line 4</li>
    <li>Line 5</li>
    <li>Line 6</li>
    <li>Line 7</li>
    <li>Line 8 is a little bit longer</li>
</ul>

And when I set max-height to 192px, it doesn't adjust, but when I don't have max-height, it works fine. What do I have to do to fix it?

with max-height without max-height

Script Host
  • 911
  • 1
  • 11
  • 22
metiran
  • 13
  • 4

0 Answers0