I read one another post that the following should work in ie8, as a good alternative to using nth-child
css:
ul > li + li{
background-color:red;
}
ul > li + li + li{
background-color:blue;
}
ul > li + li + li + li{
background-color:green;
}
html:
<ul>
<li>item 1</li>
<li>item 2</li>
<li>item 3</li>
<li>item 4</li>
</ul>
However I can't get it to work. I tried the exact same code in a plain html file. And also can't get it to work on a fully developed website. I used ie8 development tools to debug it but the development tools is not picking up the "+" selector which is (apparently) supported.
I tried adding to to codepen and jsfiddle to show you a sample, but those two tools won't work in ie8.
http://codepen.io/anon/pen/jEPxeb
Any ideas as to what I am doing wrong?
===== UPDATE ======
As it turns out, there was something wrong with my code. On the sample I used the doctype wasn't correct, and on the fully developed website the ie only if statement was incorrect. Once I fixed those two items the code worked as expected. Thank you for all who helped me get to that conclusion.