CSS 选择器支持列表
前端  /  管理员 发布于 7年前   541
Update 6/30/09: Firefox 3.5 was released today. Like Safari 3.1 and newer (including Safari 4 beta), Opera 9.64 and newer and Google Chrome all support ALL CSS2.1 and CSS3 selectors. Here is a breakdown of all the browsers I’ve tested:
iPhn | Windows XP | Mac OSX | |||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Selector | Saf 3.2 | Saf 3.0 | goog chrm | FF 3.5 | FF 3.0 |
9.0 | Saf
3.0 | IE8 | IE7 in IE8 | Saf 4 beta | Saf 3.2 | FF 3 | |||||||||
* | √ | √ | √ | √ | √ | √ | √ | √ | √ | √ | √ | √ | √ | √ | √ | √ | √ | √ | √ | √ | √ |
E | √ | √ | √ | √ | √ | √ | √ | √ | √ | √ | √ | √ | √ | √ | √ | √ | √ | √ | √ | √ | √ |
.class | √ | √ | √ | √ | √ | √ | √ | √ | √ | √ | √ | √ | Δ | √ | √ | √ | √ | √ | √ | √ | √ |
#id | √ | √ | √ | √ | √ | √ | √ | √ | √ | √ | √ | √ | √ | √ | √ | √ | √ | √ | √ | √ | √ |
E F | √ | √ | √ | √ | √ | √ | √ | √ | √ | √ | √ | √ | √ | √ | √ | √ | √ | √ | √ | √ | √ |
E > F | √ | √ | √ | √ | √ | √ | √ | √ | √ | √ | √ | √ | Χ | √ | √ | √ | √ | √ | √ | √ | √ |
E + F | √ | √ | √ | √ | √ | √ | √ | √ | √ | √ | √ | √ | Χ | √ | √ | √ | √ | √ | √ | √ | √ |
E[attr] | √ | √ | √ | √ | √ | √ | √ | √ | √ | Δ | Δ | Δ | Χ | √ | √ | √ | √ | √ | √ | √ | Δ |
E[attr=val] | √ | Δ | √ | √ | √ | Δ | Δ | Δ | Δ | √ | √ | √ | Χ | √ | √ | √ | Δ | √ | √ | Δ | Δ |
E[attr~=val] | √ | Δ | √ | √ | √ | Δ | Δ | √ | Δ | √ | Δ | Δ | Χ | √ | √ | √ | Δ | √ | √ | Δ | Δ |
E[attr|=val] | √ | Δ | √ | √ | √ | Δ | Δ | √ | Δ | √ | Δ | Δ | Χ | √ | √ | √ | Δ | √ | √ | Δ | Δ |
:first-child | √ | Δ | √ | √ | √ | Δ | Δ | Δ | Δ | √ | Δ | Δ | Χ | √ | √ | √ | Δ | √ | √ | Δ | √ |
:link | √ | √ | √ | √ | √ | √ | √ | Χ | √ | √ | √ | √ | √ | √ | √ | √ | √ | √ | √ | √ | √ |
:visited | √ | √ | √ | √ | √ | √ | √ | Χ | √ | √ | √ | √ | √ | √ | √ | √ | √ | √ | √ | √ | √ |
:lang() | √ | √ | √ | √ | √ | √ | √ | Δ | √ | √ | Χ | Χ | Χ | √ | √ | √ | Χ | √ | √ | √ | √ |
:before | √ | √ | √ | √ | √ | √ | √ | √ | √ | √ | Χ | Χ | Χ | √ | √ | √ | √ | √ | √ | √ | Χ |
::before | √ | √ | √ | √ | √ | √ | √ | √ | √ | Χ | Χ | Χ | Χ | √ | √ | √ | √ | √ | √ | √ | Χ |
:after | √ | √ | √ | √ | √ | √ | √ | √ | √ | √ | Χ | Χ | Χ | √ | √ | √ | √ | √ | √ | √ | Χ |
::after | √ | √ | √ | √ | √ | √ | √ | √ | √ | Χ | Χ | Χ | Χ | √ | √ | √ | √ | √ | √ | √ | Χ |
:first-letter | √ | √ | √ | √ | √ | √ | √ | √ | √ | √ | √ | √ | √ | √ | √ | √ | √ | √ | √ | √ | Χ |
::first-letter | √ | √ | √ | √ | √ | √ | √ | √ | √ | Χ | Χ | Χ | √ | √ | √ | √ | √ | √ | √ | √ | Χ |
:first-line | √ | √ | √ | √ | √ | √ | √ | √ | √ | √ | √ | √ | √ | √ | √ | √ | √ | √ | √ | √ | Χ |
::first-line | √ | √ | √ | √ | √ | √ | √ | √ | √ | Χ | Χ | Χ | √ | √ | √ | √ | √ | √ | √ | √ | Χ |
The following selectors are new to CSS3 (above were in previous versions) | |||||||||||||||||||||
E[attr^=val] | √ | Δ | √ | √ | √ | Δ | Δ | Χ | Δ | √ | Χ | Χ | Χ | √ | √ | √ | Δ | √ | √ | Δ | Δ |
E[attr$=val] | √ | Δ | √ | √ | √ | Δ | Δ | Χ | Δ | √ | Χ | Χ | Χ | √ | √ | √ | Δ | √ | √ | Δ | Δ |
E[attr*=val] | √ | Δ | √ | √ | √ | Δ | Δ | √ | Δ | √ | Χ | Χ | Χ | √ | √ | √ | Δ | √ | √ | Δ | Δ |
E ~ F | √ | √ | √ | √ | √ | √ | √ | √ | √ | √ | √ | √ | Χ | √ | √ | √ | Χ | √ | √ | √ | Χ |
:root | √ | √ | √ | √ | √ | √ | √ | Χ | √ | Χ | Χ | Χ | Χ | √ | √ | √ | √ | √ | √ | √ | √ |
:last-child | √ | Χ | √ | √ | √ | Δ | Δ | Χ | Χ | Χ | Χ | Χ | Χ | √ | √ | √ | Χ | √ | √ | Δ | Δ |
:only-child | √ | Χ | √ | √ | √ | Δ | Δ | Χ | Χ | Χ | Χ | Χ | Χ | √ | √ | √ | Χ | √ | √ | Δ | Χ |
:nth-child() | √ | Χ | √ | √ | Χ | Χ | Χ | Χ | Χ | Χ | Χ | Χ | Χ | √ | √ | √ | Χ | √ | Χ | Χ | Χ |
:nth-last-child() | √ | Χ | √ | √ | Χ | Χ | Χ | Χ | Χ | Χ | Χ | Χ | Χ | √ | √ | √ | Χ | √ | Χ | Χ | Χ |
:first-of-type | √ | Δ | √ | √ | Χ | Χ | Χ | Χ | Δ | Χ | Χ | Χ | Χ | √ | √ | √ | Χ | √ | Χ | Χ | Χ |
:last-of-type | √ | Χ | √ | √ | Χ | Χ | Χ | Χ | Χ | Χ | Χ | Χ | Χ | √ | √ | √ | Χ | √ | Χ | Χ | Χ |
:only-of-type | √ | Χ | √ | √ | Χ | Χ | Χ | Χ | Χ | Χ | Χ | Χ | Χ | √ | √ | √ | Χ | √ | Χ | Χ | Χ |
:nth-of-type() | √ | Χ | √ | √ | Χ | Χ | Χ | Χ | Χ | Χ | Χ | Χ | Χ | √ | √ | √ | Χ | √ | Χ | Χ | Χ |
:nth-last-of-type() | √ | Χ | √ | √ | Χ | Χ | Χ | Χ | Χ | Χ | Χ | Χ | Χ | √ | √ | √ | Χ | √ | Χ | Χ | Χ |
:empty | √ | Χ | √ | √ | √ | Δ | Δ | Χ | Χ | Χ | Χ | Χ | Χ | √ | √ | √ | Χ | √ | √ | Δ | Δ |
:not() | √ | √ | √ | √ | √ | √ | √ | Χ | √ | Χ | Χ | Χ | Χ | √ | √ | √ | √ | √ | √ | √ | √ |
:target | √ | √ | √ | √ | √ | √ | √ | Χ | √ | Χ | Χ | Χ | Χ | √ | √ | √ | √ | √ | √ | √ | √ |
:enabled | √ | √ | √ | √ | √ | √ | √ | √ | √ | Χ | Χ | Χ | Χ | √ | √ | √ | Χ | √ | √ | √ | Χ |
:disabled | √ | √ | √ | √ | √ | √ | √ | √ | √ | Χ | Χ | Χ | Χ | √ | √ | √ | Χ | √ | √ | √ | Χ |
:checked | √ | √ | √ | √ | √ | √ | √ | √ | √ | Χ | Χ | Χ | Χ | √ | √ | √ | Χ | √ | √ | √ | √ |
IE8 Supports the CSS2.1 selectors, including pseudoclasses but not pseudo elements. (See Double Colon Notation). IE8 has support for has support for Accessible Rich Internet Applications (ARIA)
To force IE8 to render your page in IE8 compliance mode, include the following meta tag:
<meta http-equiv="X-UA-Compatible" content="IE=8" />
The CSS selector support of IE7 within IE8 (when IE8 displayes a page in IE7 compatibility mode) is identical to IE7 as a standalone. However, the CSS properties do render differently. I will have to blog about that in a seperate entry when I get around to garnering all the differences.
IE7 within IE8 understands the IE7 star hack. Because the CSS renders differently even though the selector support is the same, it may take a bit before I figure out the best filter.
The original version of the iPhone came with a Safari browser that did not support all CSS3 selectors. The currently active version of Safari on the iPhone does support all CSS3 selectors. The grid below has been updated to reflect that. I have kept the old version of the iPhone CSS3 support just in case you want to support "unlocked" version of the iPhone, that do not get updated as often. Personally, I assume all iphones hitting my apps support all CSS3. For more information on iPhones, see iPhone CSS Support
Safari 4.0 Beta was released Feb. 24, 2008. Since Safari 3.2 supported all CSS selectors, this Safari 4 part of the post may be a bit mute. Safari 4 beta also supports ARIA and for CSS effects, animation and canvas. It also seems to have many more native debugging tools native to the application (or maybe what I see is a carry over from the tools I installed in my previous version of Safari). Safari 4 is Acid 3 compliant!
IE8 Notes:
IE7 within IE8 Notes:
122 在
学历:一种延缓就业设计,生活需求下的权衡之选中评论 工作几年后,报名考研了,到现在还没认真学习备考,迷茫中。作为一名北漂互联网打工人..123 在
Clash for Windows作者删库跑路了,github已404中评论 按理说只要你在国内,所有的流量进出都在监控范围内,不管你怎么隐藏也没用,想搞你分..原梓番博客 在
在Laravel框架中使用模型Model分表最简单的方法中评论 好久好久都没看友情链接申请了,今天刚看,已经添加。..博主 在
佛跳墙vpn软件不会用?上不了网?佛跳墙vpn常见问题以及解决办法中评论 @1111老铁这个不行了,可以看看近期评论的其他文章..1111 在
佛跳墙vpn软件不会用?上不了网?佛跳墙vpn常见问题以及解决办法中评论 网站不能打开,博主百忙中能否发个APP下载链接,佛跳墙或极光..
Copyright·© 2019 侯体宗版权所有·
粤ICP备20027696号