سؤال

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>
هل كانت مفيدة؟

المحلول

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

ul li:nth-child(6n+3)
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top