JSFiddle - React, Tailwind, and code Playground

HTML

<ul>
  <li>1</li>
  <li>2</li>
  <li>3</li>
  <li>4</li>
  <li>5</li>
</ul>
<ul>
  <li>1</li>
  <li>2</li>
  <li>3</li>
  <li>4</li>
</ul>

CSS

* {
  margin: 0;
  padding: 0;
}

ul {
  margin-bottom: 50px;
}

li {
  background: #ccc;
}

li:nth-child(2n+1):last-child {
  background: #000;
}