Re: Previous-sibling combinator

On 28/1/12 02:09, Eli Morris-Heft wrote:
> On Jan 27, 2012 5:46 PM, "Marat Tanalin | tanalin.com
> <http://tanalin.com>" <mtanalin@yandex.ru <mailto: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...
>

I might be mistaken, but isn't

p + ul:has(>li)

equivalent to

p + ul! > li

?

-- 
Lea Verou (http://lea.verou.me | @LeaVerou)

Received on Saturday, 28 January 2012 01:59:30 UTC