Good time everybody, i have several elements with class 'someclass' and name 'somename', and a complex selector like:
.someclass[name="somename"]
And i want to add style only to 2nd element. So i try
.someclass[name="somename"]:nth-of-type(2) {}
but it does not work as it have to work. While if selector is not complex, for example, just:
.someclass:nth-of-type(2) {}
it works normally. I tried different kind of brackets, but still have this problem. What is a solution?
UPDATE: I was looking for a way to use nth-of-type for elements, that goes not one-by-one.
My code was like:
<div class="someclass" name="somename">1</div>
<div class="someclass2" name="somename">2</div>
<div class="someclass" name="somename">3</div>
<div class="someclass" name="somename">4</div>
<div class="someclass" name="somename">5</div>
That's why my code does not worked! Finally there are some solutions in comments
