Re: [selectors] Tree selectors

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 UTC