I have a list from which I would like to build two columns. The list may contain a variable number of elements, but max. out of 8
I always want 4 elements in the first column. I already tried column-count: 2, but this does not work fine on an unequal number, because the first line should contain 4 elements.
.container {
border: 1px solid red;
width: 300px;
height: 90px;
}
<div class="container">
<ul>
<li>1</li>
<li>2</li>
<li>3</li>
<li>4</li>
<li>5</li>
</ul>
</div>
Run codeHide result
source
share