css21: counter-reset supported?

Allan Sandfeld Jensen kde at carewolf.com
Wed Apr 6 17:20:07 BST 2005


On Wednesday 06 April 2005 17:24, Mikolaj Machowski wrote:
>
> I have these lines in CSS:
>
> h2:before { content : counter(chapter)" "; counter-increment : chapter ;
> counter-reset : section subsection subsubsection paragraph }
> h3:before { content : counter(chapter)"."counter(section)" ";
> counter-increment : section ; counter-reset : subsection subsubsection
> paragraph }
> h4:before { content :
> counter(chapter)"."counter(section)"."counter(subsection)" ";
> counter-increment : subsection ; counter-reset : subsubsection paragraph }
> h5:before { content :
> counter(chapter)"."counter(section)"."counter(subsection)"."counter(subsubs
>ection)" "; counter-increment : subsubsection ; counter-reset : paragraph }
> h6:before { content :
> counter(chapter)"."counter(section)"."counter(subsection)"."counter(subsubs
>ection)"."counter(paragraph)" "; counter-increment : paragraph}
>
The problem is that you reset in :before elements, which are a child-element 
of h3. Counter-reset only resets the counter for its siblings and children, 
not for the siblings of its parent. 
Futunately Opera has implemented it the same way I have :)

It is not a bug. It's a feature.

`Allan




More information about the kfm-devel mailing list