This is not a bug, it's due to the fact the the selector doesn't match natively.
A simple selector is either a type selector or universal selector followed immediately by zero or more attribute selectors, ID selectors, or pseudo-classes, in any order. The simple selector matches if all of its components match.
The simple selector in this case is either span:first-child
, which matches natively in IE8, or span:last-child
, which does not.
One pseudo-element may be appended to the last simple selector in a chain, in which case the style information applies to a subpart of each subject.
Appending :after
to span:first-child
is a match, while appending it to span:last-child
is not, and since Selectivizr is a post-processor, it comes too late to save the day. Perhaps a pre-processor would have better luck.
span:last-child
orspan:after
rules work in your stylesheet? – Paulinapauline:last-child
works, but I don't know how to test:after
by itself. This works in IE9 and WebKit, and I assume in Firefox also. – Tollefsonspan:after {content: "test";}
and see if it works in IE8. (It should.) – Paulinapaulinecontent
works.last-child
also works, thanks to Selectivizr. The problem is that they don't work when chained together. I've tested withfirst-child
(natively supported by IE8) instead and it works:p:first-child:after {content: "foobar";}
Therefore, I conclude that it's not working because Selectivizr doesn't support chaining pseudo-elements|classes. Thanks for you help! – Tollefson