Re: [CSS21] Possible counters() limitation?

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