View Single Post
Old 07-02-2013, 09:38 PM   #1
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
Q: CSS 'counter', 'counter-increment', etc.

I came across the CSS content, counter, counter-increment, and counter-reset and thought that these would be a great ( = 'easy') way to number sections and chapters.

Works great (text, TOC, etc.) in Sigil and in Calibre viewer, but in ADE and the Kindle the numbering and the content (like 'Section, 'Topc', 'Area' below don't appear.

Is this a lack of functionality in ADE and Kindle, or is there a workaround?


Code:
body
{
counter-reset:section;
}
h1
{
counter-reset:subsection;
}
h2
{
counter-reset:subsubsection;
}
h1:before
{
counter-increment:section;
content:"Section " counter(section) ". ";
}
h2:before 
{
counter-increment:subsection;
content:"Topic " counter(section) "." counter(subsection) " ";
}
h3:before 
{
counter-increment:subsubsection;
content:"Area "counter(section) "." counter(subsection) "." counter(subsubsection) " ";
}


Paul
Attached Thumbnails
Click image for larger version

Name:	Capture.JPG
Views:	304
Size:	62.4 KB
ID:	107581  
Attached Files
File Type: epub Test CSS Counter.epub (3.1 KB, 200 views)

Last edited by phossler; 07-04-2013 at 05:03 PM.
phossler is offline   Reply With Quote