Is there a way to for instance target the 5th .slide element with a css code like this:
HTML
<div id="slides">
<section>
<div class='slide'></div> this should be 1
<div class='slide'></div> this should be 2
<div class='slide'></div> this should be 3
</section>
<section>
<div class='slide'></div> this should be 4
</section>
<section>
<div class='slide'></div> this should be 5 I target this one
<div class='slide'></div> this should be 6
<div class='slide'></div> this should be 7
</section>
</div>
CSS
.slide:nth-of-type(5) {
background:red;
}
I thought something like that would work but it didn't.
I basically want to acces each element with the corresponding number so the 7th with a seven in the css
i'm open for jquery solutions if needed