At 6:58 AM +0100 6/16/05, Christian Heilmann wrote:
> >>> Isn't the other way around?
>
> no
> http://www.w3.org/TR/REC-CSS2/selector.html#q15
?
But this URI shows the following example:
A.external:visited { color: blue }
element > class > pseudo-class
(the other way around seems to work the same though...)
Yes, I was wrong. However, in both IE and Firefox only the wrong
syntax (pseudo, then class) works. Anyone knows why? All other
tutorials seem to "cheat" by adding a class to the parent element
(which might make more sense anyway).
I think you are confusing pseudo-elements and pseudo-classes. The
spec says [1] "Pseudo-classes are allowed anywhere in selectors while
pseudo-elements may only appear after the subject of the selector."
In other words, the spec views a.external:visited and
a:visited.external as functionally equivalent. (Note that Mozilla
will accept both of these.) However, a.external:first-line is
correct, while a:first-line.external is nonsensical (you cannot apply
a class to a pseudo-element), as is a:first-line span (you cannot
target a hard-coded element inside a pseudo-element).
So when it comes to pseudo-CLASSES, there is no "wrong syntax" in the
sense you mean. There are, however, wrong browsers that won't accept
an otherwise allowable syntax. But for pseudo-ELEMENTS, all browsers
are correct to apply strict rules.
Does that help at all?
1. <http://www.w3.org/TR/CSS21/selector.html#pseudo-elements>
--
-Adam Kuehn
______________________________________________________________________
css-discuss [EMAIL PROTECTED]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/