Re: Counter-reset on pseudo class creates new counter-scope

On Tuesday 05 January 2010, Boris Zbarsky wrote:
> Sure. A reset only creates a new instance if there is a counter with
> that name is already in scope solely due to a reset on an ancestor or
> previous sibling of an ancestor.  A reset for a counter that's in scope
> due to a reset on a previous sibling will just reset the existing counter.
> 
Which is why the trick is to use:
                
ol:before {
 content: "";
 counter-reset:section;
}
                
ol li {
 counter-increment: section;
}



`Allan

Received on Monday, 11 January 2010 12:57:05 UTC