I previously had a setup where items in a list would have alternate colors using jQuery:
$('ul.follows li:nth-child(odd)').addClass('alternate');
Everything was functioning properly until I introduced an a
tag before the list items. Now, my structure looks like this:
<ul class="follows">
<a href="#">
<li class="me">
<img src="#">
<h3>#</h3>
<p>#</p>
</li>
</a>
...</ul>
Any insights on why it suddenly stopped working?
I could place the <a>
inside the <li>
, but then I'm unsure how to make the entire item clickable...