Style first, last and every other item
Select items by position without extra classes.
CSS · Style first, last and every other itemBeginner
li:first-child { border-top-left-radius: 8px; border-top-right-radius: 8px; }
li:last-child { border-bottom: 0; }
li:nth-child(odd) { background: #f9fafb; }
li:nth-child(3n) { font-weight: 700; }
li:not(:last-child) { border-bottom: 1px solid #e5e7eb; }pseudo-classnth-childfirst-childlist