tags:

views:

35

answers:

1

Are these selectors part of CSS 2.1, CSS 3, or both?

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

Arte these total available selectors in CSS? please tell which selector is part of which CSS version?

*
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  A: 

All CSS 3.

The last one E ~ F is the general sibling combinator.

See the quirksmode.org compatibility table for info on which selector is supported by which browser.

Pekka
but some are also supported even in IE7
metal-gear-solid
So to sum this up: `E:last-child`, `E[att^="val"]`, `E[att$="val"]`, `E[att*="val"]`, and `E ~ F` are all to be introduced with CSS 3.
Gumbo
@metal-gear true!
Pekka
@Pekka: Sorry, I am wrong, only `E:first-child` was introduced with CSS 2, but not `E:last-child`. So all are to be introduced with CSS 3.
Gumbo
@Gumbo ah, that's the way I initially read it but I thought `last-child` was part of the package without mentioning. Reverting, cheers.
Pekka
@Pekka - sorry ,I updated question. Please give answer to second question also. Thanks.
metal-gear-solid
@metal-gear Re your edit: I posted two links featuring the complete lists of selectors in CSS 2 and 3. Please go and look them up yourself. When you do, be sure to add the result as an answer here, it's likely to benefit others in the future.
Pekka
that list has only CSS 2.1 and CSS 3 selectors. is that mean no selectors were proposed in CSS 1 ans 2?
metal-gear-solid
@metal CSS1 specification: http://www.w3.org/TR/2008/REC-CSS1-20080411/ (no nice selector table though)
Pekka
@Pekka - I think `Class`, `ID` and Contextual selectors were part of CSS 1
metal-gear-solid
@metal yes, and a number of pseudo-classes: `:link` `:visited` `:active` `:first-line` `:first-letter` that should be it.
Pekka
@Pekka - some info on this link also but not much clear http://mobiforge.com/designing/story/comparison-css-21-css-mp-wcss-and-css-level-1
metal-gear-solid
CSS 1 cheat sheet http://www.digilife.be/quickreferences/QRC/Cascading%20Style%20Sheets%201.0.pdf
metal-gear-solid