- From: Allan Sandfeld Jensen <kde@carewolf.com>
- Date: Sun, 10 Sep 2006 23:49:42 +0200
- To: www-style@w3.org
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 UTC