LinkedIn CSS Skill Assessment Quiz Answers

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?

Latest Update on 23rd March, 2022 by Certification Course Answers

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?

  1. li:nth-child(3 + 2n) {
      margin: 0 5 px;
    }
  2. li:nth-child(3n + 2) {
      margin: 0 5 px;
    }
  3. li:nth-child(2),
    li:nth-child(5),
    li:nth-child(8) {
      margin: 0 5 px;
    }
  4. li:nth-child(2n + 3) {
      margin: 0 5 px;
    }

Correct Answer:

  • li:nth-child(3n + 2) {
      margin: 0 5 px;
    }

Latest Updates

No posts found in this category.