I have the following html and I want to show only the first ".xpto" element. My problem is that I'm removing the class .xpto dynamically, so when I do it, the first .xpto element will be the second inner div. How can I accomplish this?
<div>
<div class="xpto"></div>
<div class="xpto"></div>
<div class="xpto"></div>
<div class="xpto"></div>
</div>
I tried, :first-child, :first-of-type and :nth-child(1n) but nothing worked. Any ideas? (CSS only)
Test case: http://jsfiddle.net/7YRAF/