View Single Post
Old 07-02-2013, 09:53 PM   #2
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 31,109
Karma: 60406498
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
Quote:
Originally Posted by phossler View Post
I can 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
I think you found one of the CSS things that is not part of the EPUB spec, but works in some viewers

Rule of thumb: don't count on these kinds of Features, they will fail when you most need them
theducks is offline   Reply With Quote