There seems to be a bug in calculation of multi column css property, present in all browsers I have checked in (latest Chrome, IE11 and Firefox). If you have 9 items in your list, and try to split it in 4 columns, the last column is always empty.
Are there any workarounds, something that will split it 3/2/2/2? Thanks in advance.
ul {
-moz-column-count: 4;
-webkit-column-count: 4;
column-count: 4;
background-color: gray;
}
li {
background-color: tomato;
}
<ul>
<li>item</li>
<li>item</li>
<li>item</li>
<li>item</li>
<li>item</li>
<li>item</li>
<li>item</li>
<li>item</li>
<li>item</li>
</ul>
http://caniuse.com/#feat=multicolumn
It looks like the column-* has alot of issues with different browsers. In your example if you were to add 1 more li element, then you can see it will fill itself in on the 4th column. My guess is its a divisibility issue.
It is working in same way that it supposed to work, there is enough space in 3 columns for 9 items that's why its not going into 4th, reduce height and it will be divide in more columns. or add more li
that will go in 4th column
ul {
-moz-column-count: 4;
-webkit-column-count: 4;
column-count: 4;
background-color: gray;
height:50px;
}
li {
background-color: tomato;
}
<ul>
<li>item</li>
<li>item</li>
<li>item</li>
<li>item</li>
<li>item</li>
<li>item</li>
<li>item</li>
<li>item</li>
<li>item</li>
</ul>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With