简体   繁体   English

IE8中的链接伪选择器

[英]Chained pseudo-selectors in IE8

Chained pseudo-selectors do not seem to work in IE8 on Windows XP. 在Windows XP的IE8中,链接的伪选择器似乎不起作用。 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): 我正在使用Selectivizr开发一个网站,以使用CSS3选择器,但是这种样式在IE8中不起作用,而在其他所有地方都可以使用(毫不奇怪):

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

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. 简单选择器可以是类型选择器,也可以是通用选择器,紧随其后的是零个或多个属性选择器,ID选择器或伪类(以任何顺序)。 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. 在这种情况下,简单的选择器要么是span:first-child (在IE8中本机匹配),要么是span:last-child (不匹配)。

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. :after附加到span:first-child是一个匹配项,而将其附加到span:last-child是不匹配的,并且由于Selectivizr是后处理器,因此来不及节省时间。 Perhaps a pre-processor would have better luck. 也许预处理器会更好。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM