Previous Message
Next Message

classes and IDs...mutually exclusive?

Sent by Michael Landis on 16 October 2003 22:10


Liorean wrote:

> A selector goes from less specific to more specific, so you'll
> have to do in in tag.class#id:pseudoclass::pseudoelement order.

Hi, Liorean,

Actually you have some freedom about how you want to arrange selector
components. As long as the tag is first, and the psuedo-element is last,
everything else can be arranged however you like -- class first, id first,
pseudo-class first, whatever. The 2.0 specs are pretty clear on this, and
in testing this out on PC IE 5.x and Moz the following selectors all work:

a:link.class#id
a.class#id:link
a#id:link.class

The main limitation is that pseudo-elements must always be last; the
following wouldn't work:

p:first-line.class

Since you can't have a class on an element that doesn't actually exist...

Anyways, this can help each person choose the methodology that makes sense
to them.

HTH,

MikeL

______________________________________________________________________
css-discuss [EMAIL-REMOVED]]
http://www.css-discuss.org/mailman/listinfo/css-d
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/
Previous Message
Next Message

Possibly related: