W3C home > Mailing lists > Public > www-style@w3.org > March 2005

Re: [selectors] Tree selectors

From: BachusII <BachusII@planet.nl>
Date: Mon, 21 Mar 2005 13:16:21 +0100
To: Ian Hickson <ian@hixie.ch>
Cc: Anne van Kesteren <fora@annevankesteren.nl>, W3C CSS List <www-style@w3.org>
Message-id: <423EBB15.6080307@planet.nl>
How about counting only tags of one type. 0-based, the n-th descending 
tag of type x from the starting/base tag x.

*level*                  *possible selector(s)*
 <ul>                  ul:depth(0) / ul
  <li>
   <ul>                ul:depth(1) / ul ul (/ ul>*>ul)
    <li>
     <div>
      <ul>             ul:depth(2) / div>ul:depth(0) / ul ul ul / div>ul
       <li>
        <ul>           ul:depth(3) / div>ul:depth(1) / ul ul ul ul / div>ul ul
         <li>

where  :depth(arg) has the possible values n, an+b, odd, even.


Ian Hickson wrote:

>On Mon, 21 Mar 2005, Anne van Kesteren wrote:
>  
>
>>... I think some :depth(arg) pseudo-class or other method should be 
>>designed to have similar options for trees.
>>    
>>
>
>This has been suggested before, but no solid proposal has been suggested 
>yet. The problems lie in deciding where the counting should start, so as 
>to correctly handle things like:
>
>   <ul>
>    <li>
>     <ul>
>      <li>
>       <div>
>        <ul>
>         <li>
>
>...or:
>
>   <section>
>    <h/>
>    <section>
>     <h/>
>     <section>
>      <h/>
>      <section>
>       <div>
>        <h/>
>       </div>
>
>Proposals welcome.
>
-

 

 

Groeten Joost
BachusII@planet.nl

 

This disclaimer absolves us of absolutely everything ever. By reading 
this sentence you hereby agree to whatever terms and conditions we see 
fit to inflict upon you
Received on Monday, 21 March 2005 15:05:01 GMT

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