Yes, there is a way to emulate only with CSS and without javascript, points that are question requirements, Nth-Child only with CSS. It’s a little more work, but it’s viable.
former_element + target_element { style properties }
element:first-Child { style properties }
Nth-Child equivalent with Fist-Child and sibling
/* Primeiro filho */
li:nth-child(1) {}
li:first-child {}
/* Segundo filho */
li:nth-child(2) {}
li:first-child + li {}
/* Terceiro filho filho */
li:nth-child(3) {}
li:first-child + li + li {}
How to do Nth-Child(Odd), Nth-Child(3n+2) and others?
In this case, it’s a little more work. To work with IE8 and up to IE7 you will manually need all the comma-separated equivalents up to a limit where you find interesting Nth-Child would calculate to infinity, but in your CSS you would have to put a number as far as you think pertinent
li:nth-child(2n) {}
/* Equivalente até o oitavo valor */
li:first-child + li,
li:first-child + li + li +li,
li:first-child + li + li + li + li + li,
li:first-child + li + li + li + li + li + li + li {
}
Alternatives
Other solutions will necessarily involve javascript code or additional markup in your HTML. Unless it’s really necessary and nothing simple to solve, it’s not interesting to add even more javascript to your page, especially if it’s complex.
IE8 and in particular IE7 may take a long time, but much longer to process the page when using polyfills to a point where it is unacceptable.
A page that rendered in 200ms in Chrome, when using polyfills for Nth-Child came smoothly to 7 seconds. At the time I solved just adding more classes in HTML
I answered your question exactly, without using Javascript. If you believe you are better, you can still exchange and by the right answer.
– Emerson Rocha