在IE8中的链式伪选择器 [英] Chained pseudo-selectors in IE8

查看:159
本文介绍了在IE8中的链式伪选择器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

链接的伪选择器似乎不适用于Windows XP上的IE8。有没有关于这个的文档?

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

我正在使用Selectivizr开发一个网站,以使用CSS3选择器,但像这样的风格在IE8不工作,

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";}


推荐答案

这不是一个错误,选择器本身不匹配。

This is not a bug, it's due to the fact the the selector doesn't match natively.


一个简单的选择器是一个类型选择器或通用选择器,紧跟着零个或多个属性选择器,ID选择器或伪类,以任何顺序。

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.

在这种情况下,简单选择器是 span: first-child ,它与IE8中的本机匹配,或 span:last-child ,不匹配。

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.

之后加上 span:first-child 是一个匹配,而将它附加到 span:last-child 不是,并且由于Selectivizr是一个后处理器,它太晚才能保存一天。也许一个预处理器会有更好的运气。

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.

这篇关于在IE8中的链式伪选择器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆