It's not possible to achieve this using pure css because nth-of-type only selects based on an element's parent relationship (w3schools). Therefore, I am seeking a jquery alternative that can be applied across multiple lists.
HTML:
<div class="container" id="videos">
<ul class="thumbnails">
<li class="tn">
<img class="tn-img" src="img/thumbnails/placeholder.jpg" />
</li>
<li class="tn">
<img class="tn-img" src="img/thumbnails/placeholder.jpg" />
</li>
<li class="tn">
<img class="tn-img" src="img/thumbnails/placeholder.jpg" />
</li>
<li class="tn">
<img class="tn-img" src="img/thumbnails/placeholder.jpg" />
</li>
</ul>
<ul class="thumbnails">
<li class="tn">
<img class="tn-img" src="img/thumbnails/placeholder.jpg" />
</li>
<li class="tn">
<img class="tn-img" src="img/thumbnails/placeholder.jpg" />
</li>
</ul>
<ul class="thumbnails">
<li class="tn">
<img class="tn-img" src="img/thumbnails/placeholder.jpg" />
</li>
<li class="tn">
<img class="tn-img" src="img/thumbnails/placeholder.jpg" />
</li>
<li class="tn">
<img class="tn-img" src="img/thumbnails/placeholder.jpg" />
</li>
<li class="tn">
<img class="tn-img" src="img/thumbnails/placeholder.jpg" />
</li>
<li class="tn">
<img class="tn-img" src="img/thumbnails/placeholder.jpg" />
</li>
</ul>
</div>
JQUERY
$( "#videos li:nth-of-type(5n+1) img" ).css( "margin-left", "0px");
This code is still targeting :nth-of-type(5n+1) in relation to its parent (the unordered list). This is evident as the first list item in every ul is being selected. My objective is to select the 5th list item across all unordered lists, without considering their parent elements.