View Single Post
Old 07-05-2013, 09:51 PM   #16
phossler
Wizard
phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.
 
Posts: 1,071
Karma: 412718
Join Date: Jan 2009
Location: Valley Forge, PA, USA
Device: Kindle Paperwhite
My little project is really coming togeather; your explainations have really helped a lot

So I tried emulate a numbering style that I've seen many times:

H1's = Section x
H2's = Chapter x

Except that the H2 counter doesn't get reset to 1 when the H1 changes, and the H1's continue to Increment:

Section 1
Chapter 1
Chapter 2
Chapter 3

Section 2
Chapter 4
Chapter 5
Chapter 6

It looks so easy. I have the H2's continuing to increment, but the H1 counter remains 'stuck' at 1.

Can anyone see what I'm doing wrong, or not doing right?

Code:
body
{
counter-reset:h1number;
counter-reset:h2number;
}

h1:before 
{
counter-increment:h1number;
content:"Section# " counter(h1number) " – ";
}

h2:before 
{
counter-increment:h2number;
content:"Chapter# " counter(h2number) " – ";
}

Thanks

Paul
Attached Thumbnails
Click image for larger version

Name:	Capture.JPG
Views:	176
Size:	75.5 KB
ID:	107793  
Attached Files
File Type: epub Test CSS Counter2.epub (2.8 KB, 139 views)
phossler is offline   Reply With Quote