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

Previous-sibling combinator

From: Marat Tanalin | tanalin.com <mtanalin@yandex.ru>
Date: Sat, 28 Jan 2012 03:05:07 +0400
To: www-style@w3.org
Message-Id: <132881327705507@web5.yandex.ru>
Hello.

It would be nice to have combinator to select previous sibling.

    P - UL {
        /* Styles for UL element which is
           previous sibling of P element. */
    }

The "-" combinator is functionally similar to existing "+" combinator, but selects previous-sibling element instead of next-sibling one.

So in result we would have "+" to move forward, and "-" to move backward (like element.nextSibling and element.previousSibling in DOM, respectively).

Thanks.
Received on Friday, 27 January 2012 23:05:45 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:20:49 GMT