Currently, only Safari supports the selector-list argument of :nth-child()
introduced in selectors-4.
There is no other way to do this in CSS besides adapting the overriding technique from here, but with an additional selector for the 3rd .mySpans
onward:
div#myId > span.mySpans, div#myId > span.mySpans ~ span.mySpans ~ span.mySpans {
/* ... */
}
div#myId > span.mySpans ~ span.mySpans {
/* Remove from previous rule */
}
If this is in JavaScript or some other API that returns a set of elements as the string-like notation in your question suggests, you can just index off of it since your parent element has an ID and therefore you're only concerned with one set of elements (assuming the parent ID is actually unique, of course):
document.querySelectorAll('div#myId > span.mySpans')[1]
See also: Can I combine :nth-child() or :nth-of-type() with an arbitrary selector?