Hello Everyone,
Please consider below example:
<div>
<h1>Hello</h1>
<p>Paragraph</p>
<p>Target</p>
</div>
Here I can select first p and second p tags by using selectors "p:nth-of-type(1)" and "p:nth-of-type(2)" respectively.
However in below example, I'm not able to select first label using ".label:nth-of-type(1)".
<div class="row">
<div class="icon">A</div>
<div class="icon">B</div>
<div class="label">1</div>
<div class="label">2</div>
<div class="label">3</div>
</div>
If I use selector ".label:nth-of-type(3)", it works. Could any one please explain me why selector ".label:nth-of-type(1)" didn't work?
Thanks,
Sanjay Maurya
Bookmarks