W3C home > Mailing lists > Public > www-style@w3.org > January 2004

[css3] Proposal: Additional adjacent combinator (E - F)

From: Jens Meiert <jens.meiert@erde3.com>
Date: Tue, 27 Jan 2004 10:47:48 +0100 (MET)
To: "W3C CSS" <www-style@w3.org>
Message-ID: <27815.1075196868@www67.gmx.net>

Encountering several scenarios where this might be useful, I thought about
the need for another type of selector, which also complies with an direct
adjacent combinator. According to the CSS3 selectors specification [1], this
selector could be defined as

    E - F
    An element E whose adjacent sibling F immediately follows it

For example and only consequently, the following document snippets could be
formatted completely different without any need for a class, style, or id

    <h1 />
    <p />


    <h1 />
    <div />

Next, if I want to change the headline formatting when a div element is
following, I could easily specify

    h1 { /* Any declaration */ }
    h1 - div { /* An additional or overriding declaration */ }

Is it worth consideration, or did I miss something? -- I'm aware that the
structural pseudo classes offer a powerful set of selectors to maybe solve the
problem above, but this suggestion seems easier anyway.

Best regards,

[1] http://www.w3.org/TR/2001/CR-css3-selectors-20011113/#selectors

Jens Meiert
Interface Architect

Received on Tuesday, 27 January 2004 08:58:03 UTC

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:27:11 UTC