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 GMT

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