Using the :nth-child pseudo class, what would be the most efficient way to style every third item in a list, no matter how many items are present, starting with item 2?

Advertisement

  • li:nth-child(3 + 2n) {
    margin: 0 5 px;
    }
  • li:nth-child(3n + 2) {
    margin: 0 5 px;
    }
  • li:nth-child(2),
    li:nth-child(5),
    li:nth-child(8) {
    margin: 0 5 px;
    }
  • li:nth-child(2n + 3) {
    margin: 0 5 px;
    }
Join our list

Subscribe to our mailing list and get interesting stuff and updates to your email inbox.

Thank you for subscribing.

Something went wrong.

Leave a Comment


Share via
Join our list

Subscribe to our mailing list and get interesting stuff and updates to your email inbox.

Thank you for subscribing.

Something went wrong.

Send this to a friend