Jesper Hermansen wrote: > A quick example. > Say I want to show/hide an html-<img>, when hovering different links. > > I'm using a slash (/) for doing a new selector (maybe someone can think > of a better character). > > Markup: > <img id="logo" src="foo/bar.png" alt="foobar" /> > <a href="http://www.google.com/">Google</a> > <a href="/examples/">Site examples</a> > <a href="http://w3.org/">W3</a> > > CSS: > > #logo { > visibility: hidden; > } > > a[href^="http://"]:hover / #logo { > visibility: visible; > } I'm not sure I understand this properly, there's two possible interpretations I can think of. The first, which I interpret from the sample code and which I'm sure has been discussed before, is like the opposite of the + and ~ sibling combinators. This would suffer from many of the same problems of parent selectors. > The selector above would first evaluate hover on the link and, if true, > continue to the #logo-selector, and apply the visibility-style. The second which I gather from this description is like putting a condition which must evaluate to true before the actual selector will be matched. i.e. selector1 / selector2 { ... } is equivalent to this pseudo-code algorithm. IF selector1 matches anything find matches for selector2 and apply styles END IF This concept seems somewhat like the previously proposed :matches() pseudo-class (there's plenty of discussion about it in the archives), but it too has significant problems and we're unlikely to see it any time soon, if at all. If I understand correctly, the above example would be equivalent to selector2:matches(selector1) { ... } -- Lachlan Hunt http://lachy.id.au/Received on Wednesday, 21 December 2005 12:45:31 GMT
This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 27 April 2009 13:54:42 GMT