Please use following CSS syntax to style the second last element in a list or group.

<style>
  .list-number-123 {
    list-style: none;
  }

  .list-number-123 li:nth-last-child(2) {
    background: #edeaea;
    color: #30a960;
    font-weight: 700;
    padding: 10px;
  }
</style>

<ul class="list-number-123">
  <li>Item 1</li>
  <li>Item 2</li>
  <li>Item 3</li>
  <li>Item 4</li>
  <li>Item 5</li>
  <li>Item 6</li>
  <li>Item 7</li>
</ul>
  • Item 1
  • Item 2
  • Item 3
  • Item 4
  • Item 5
  • Item 6
  • Item 7