Redo selectors instead of parent-selectors

Hi!

I've been reading the archives about parent-selectors, and the problems 
that seem to be with them when going up the tree.

Instead of doing a parent-selector, how about a new selector!

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;
}

The selector above would first evaluate hover on the link and, if true, 
continue to the #logo-selector, and apply the visibility-style.

What I would like to see, is when then hover-event occurs on the anchor, 
the image should vi visible. I know it's easier to put the image after 
the anchors, but that's not the point of the selector.

I hope you get the idea, and that something similar hasn't already been 
proposed.

Jesper Hermansen

Received on Wednesday, 21 December 2005 11:44:20 UTC