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

Re: Previous-sibling combinator

From: Eli Morris-Heft <eli.morris.heft@gmail.com>
Date: Fri, 27 Jan 2012 18:09:31 -0600
Message-ID: <CABcnqoX1L0gOM4e9N12bjq5s_QzSjzB1a=mVb6VbALdwpfzqnQ@mail.gmail.com>
To: "Marat Tanalin | tanalin.com" <mtanalin@yandex.ru>
Cc: www-style@w3.org, "Tab Atkins Jr." <jackalmage@gmail.com>
On Jan 27, 2012 5:46 PM, "Marat Tanalin | tanalin.com" <mtanalin@yandex.ru>
wrote:
>    P - UL > LI
>    :matches(!UL + P) > LI

Though it's a bit silly, it occurs to me to note that the previous-sibling
selector isn't a cure-all. What if you want to refer to the ul in your
example? You need something like:

p - !ul > li
or
p + ul:has(> li)

Damn. I used to be a fan of the ! indicator, but I think I just talked
myself out of it...
Received on Saturday, 28 January 2012 00:10:09 UTC

This archive was generated by hypermail 2.4.0 : Monday, 23 January 2023 02:14:09 UTC