2010-07-04 71 views
1

這些選擇器是CSS 2.1,CSS 3還是兩者的一部分?這些選擇器是CSS 2.1還是CSS 3的一部分?

E[att^="val"] 
E[att$="val"] 
E[att*="val"] 
E:last-child 
E ~ F 

難道這些都在CSS可用的選擇? 請告訴我哪個選擇器是哪個CSS版本的一部分?

* 
E 
.class 
#id 
E F 
E > F 
E + F 
E[attribute] 
E[attribute=value] 
E[attribute~=value] 
E[attribute|=value] 
:first-child 
:lang() 
:before 
::before 
:after 
::after 
:first-letter 
::first-letter 
:first-line 
::first-line 
E[attribute^=value] 
E[attribute$=value] 
E[attribute*=value] 
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 

回答

3

所有CSS 3

最後一個E ~ Fgeneral sibling combinator

有關哪個瀏覽器支持哪個選擇器的信息,請參閱quirksmode.org compatibility table

+0

但是有些甚至在IE7中也被支持 – 2010-07-04 14:39:49

+0

所以總結一下:'E:last-child','E [att^=「val」]','E [att $ =「val」]' 'E [att * =「val」]'和'E〜F'都是用CSS引入的3. – Gumbo 2010-07-04 14:42:36

+0

@ metal-gear true! – 2010-07-04 14:43:01