In a simple pager I'm building I need to apply specific style to the current page if the current page is the first or the last page. And I don't know how to use the :first-of-type
/ :last-of-type
selector in addition to the normal class selector.
<div id="myPages">
<div class="something-else"></div>
<div class="page-number current-page">1</div>
<div class="page-number">2</div>
<div class="page-number">3</div>
<div class="another-one"></div>
</div>
I'd like something like #myPages .page-number:first-of-type.current-page
but it does not work because of the something-else
and another-one
div.
In my jsFiddle for example, I'd like the '1' to be blue.
Thanks for your help.
[edit] I've updated the fiddle, I think it's the best way to get my idea :)