Question

How can I select every other 3rd element in an unordered list like below? I have a random amount of <li>'s but I need every other 3rd so for example the third, the ninth, the fifteenth, etc. is such a thing possible in html or css or javascript?

<ul>
    <li></li>
    <li></li>
    <li></li>
    <li></li>
    ...
</ul>
Was it helpful?

Solution

You're actually looking to select every sixth element, but starting from the third:

ul li:nth-child(6n+3)
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top