How can I apply a top margin to each li
element within a ul
element that utilizes the css property column-count: 2
? I am facing an issue where the margin is being applied to every li
element except the first one in the second column:
ul {
column-count: 2;
padding: 0;
border: 1px solid black;
}
li {
margin-top: 10px;
}
li:nth-child(1) {
background-color: red;
}
li:nth-child(5) {
background-color: blue;
}
<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>
</ul>