Re: [selectors] Tree selectors

On Mon, 21 Mar 2005, BachusII wrote:
>
> 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.

This wouldn't handle, e.g.:

   <body>
    <h>
    <section>
     <h>
     <navigation>
      <h>

...where we want the <h>s to render in progressively smaller sizes.

-- 
Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'

Received on Monday, 21 March 2005 12:17:20 UTC