Chained pseudo-selectors in IE8

蹲街弑〆低调 提交于 2019-12-24 10:58:28

问题


Chained pseudo-selectors do not seem to work in IE8 on Windows XP. Is there any documentation about this?

I'm developing a website using Selectivizr in order to use CSS3 selectors, but a style such as this doesn't work in IE8, whereas it works everywhere else (unsurprisingly):

span:last-child:after {content: "foobar";}

回答1:


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.



来源:https://stackoverflow.com/questions/11577639/chained-pseudo-selectors-in-ie8

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!