[Prev][Next][Index][Thread]

selectors in CSS



Lauren Wood writes:

 > Are authors allowed to specify a context using just the class for
 > ancestors, e.g. ".foo P" or the id, e.g. "#foo P"? This would mean any P
 > with an ancestor of class foo, independent of the element type of the
 > ancestor.

Yes. The specification [1] says:

  "Context-sensitive selectors can look for tags, classes or ids"

".. and combinations of these." should probably be added at the end of
that sentence.

[1] http://www.w3.org/pub/WWW/TR/WD-css1

Regards,

-h&kon

Hakon W Lie, W3C/INRIA, Sophia-Antipolis, France
http://www.w3.org/people/howcome  howcome@w3.org


References: