W3C home > Mailing lists > Public > www-style@w3.org > June 2005

[CSS2.1] Counters nesting

From: Allan Sandfeld Jensen <kde@carewolf.com>
Date: Thu, 16 Jun 2005 02:52:55 +0200
To: www-style@w3.org
Message-Id: <200506160252.55236.kde@carewolf.com>

With the new clarification of counter nesting, I have a corner case question. 

Given the following CSS and HTML snippets:

root: { counter-reset: item }
parent: { counter-reset: item; counter-increment: item }
child, sibling: {counter-increment: item }
child::after, sibling::after: { content: counter(item) "," counters(item) }

<root>
<parent>
	<child> Should be 2, 1.1 (?): </child>
	<child> Should be 3, 1.2 (?): </child>
</parent>
<sibling> Is it 2, 3, 4 or even 1.3? </sibling>
<root>

What should the sibling show?

In other words does the reset work separately on sibling and children? And is 
the counter-increment then counted as a child or as a sibling?

In the original I would have said 1.3 to be consistant, but since the nesting 
now only affects children, it seems very odd to become 4..

`Allan
Received on Thursday, 16 June 2005 00:53:05 GMT

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