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

Re: [CSS21] Possible counters() limitation?

From: Simon Pieters <zcorpan@hotmail.com>
Date: Sat, 09 Sep 2006 16:51:38 +0000
Message-ID: <BAY109-F24E416A6E7BF9D23038C13B4340@phx.gbl>
To: annevk@opera.com
Cc: www-style@w3.org

Hi,

From: "Anne van Kesteren" <annevk@opera.com>
>On Sat, 09 Sep 2006 18:38:01 +0200, Simon Pieters <zcorpan@hotmail.com>  
>wrote:
>>I believe this should work:
>>
>>    :root, h + section { counter-reset:headers; }
>>    h::before { content:counters(headers, ".");  
>>counter-increment:headers; }
>
>Interesting. It stops working though when you put some paragraphs between  
>the heading and the first subsection and ~ doesn't really solve that...

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; }

Regards,
Simon Pieters
Received on Saturday, 9 September 2006 16:51:50 GMT

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