W3C home > Mailing lists > Public > www-style@w3.org > October 2008

Re: Selector Sugar

From: Andrew Fedoniouk <news@terrainformatica.com>
Date: Fri, 10 Oct 2008 11:57:04 -0700
Message-ID: <48EFA580.7000600@terrainformatica.com>
To: Simetrical <simetrical@gmail.com>
CC: "Tab Atkins Jr." <jackalmage@gmail.com>, Brad Kemper <brkemper.comcast@gmail.com>, W3C Style List <www-style@w3.org>, Fran├žois REMY <fremycompany_pub@yahoo.fr>

Simetrical wrote:
> [skipped] As a practical
> example, consider something like
>
> div span:match(span + span)
>
> which matches a span that has a div ancestor *and* is immediately
> preceded by a span.  I'm pretty sure there's no possible way to do
> this with current CSS selectors, so it's not just semantic sugar.
>
> [skiped]
>   
"there's no possible way to do this" is not correct. Try the following:

<html>
<head>
  <style>
    div span + span { color:red; }
  </style> 
<head>
<body>
  <div><span>111</span><span>222</span></div>
  <span>333</span><span>444</span>
</body>
</html>

-- 
Andrew Fedoniouk.

http://terrainformatica.com
Received on Friday, 10 October 2008 18:57:46 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 27 April 2009 13:55:15 GMT