W3C home > Mailing lists > Public > www-style@w3.org > September 2006

Re: [CSS21] Possible counters() limitation?

From: Allan Sandfeld Jensen <kde@carewolf.com>
Date: Sun, 10 Sep 2006 23:49:42 +0200
To: www-style@w3.org
Message-Id: <200609102349.43151.kde@carewolf.com>

On Saturday 09 September 2006 18:58, L. David Baron wrote:
> On Saturday 2006-09-09 16:51 +0000, Simon Pieters wrote:
> > You're right. Here's a second shot:
> >    :root, h ~ section:first-of-type { counter-reset:headers; }
> >
> >    h::before { content:counters(headers, "."); counter-increment:headers;
> > }
>
> That won't work if some sections are nested within divs, e.g.:
>
> <section>
>   <h>should be 1</h>
>   <div>
>     <section>
>       <h>should be 1.1</h>
>     </section>
>   </div>
>   <section>
>     <h>should be 1.2</h>
>   </section>
> </section>
>
In my opinion that is not a limitation of counters. That is a limitation of 
selectors. Something like the first descendant of type should be selectable, 
and adding more pseudotypes is not the solution.


`Allan
Received on Sunday, 10 September 2006 21:50:03 GMT

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