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

Re: [CSS21] Possible counters() limitation?

From: L. David Baron <dbaron@dbaron.org>
Date: Sat, 9 Sep 2006 09:58:09 -0700
To: www-style@w3.org
Message-ID: <20060909165809.GA18620@ridley.dbaron.org>
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>

-David

-- 
L. David Baron                                <URL: http://dbaron.org/ >
           Technical Lead, Layout & CSS, Mozilla Corporation

Received on Saturday, 9 September 2006 16:58:20 UTC

This archive was generated by hypermail 2.4.0 : Monday, 23 January 2023 02:13:18 UTC