css selectors

I think that there is a need for a selector in CSS, which selects an
element of a certain type which directly precedes an element of another
type. Already in CSs we can specify E+F which matches element F directly
following element E, and this would work along the same lines, something
like E-F would match an F element directly before an E element.

Perfect example of why this is needed:

Take a set of blockquotes. Now the generally held typography rule is that
every one should have a starting quote, but only the very last one from
the same source should have an ending quote. Currently, the only way you
could specify this would be to give every blockquote only a quote at the
start, and then use a class on the last blockquote and blockquotes of that
type would receive an ending quote as well. However this could very
quickly get tedious, especially when you're putting up single blockquotes
at a time.

If you had the E-F selector, you could simply use the rules:

blockquote {
	quotes: '"' '"';
}

blockquote-blockquote {
	quotes: '"' '';
}

blockquote:before {
	content: open-quote;
}

blockquote:after {
	content: close-quote;
}

And only the last one would receive an ending quote.

Lach
_____________________________________
http://members.evolt.org/luminosity/
MSN: luminosity @ members.evolt.org
_____________________________________

Received on Monday, 8 July 2002 04:26:06 UTC