0

I have epub file and it include several xhtml files and i want to add counter in the top of these files. i use CSS counter but the counter is still showing same number in all files.

i put these tag in all htmls

  <p class="custompagenumber"></p>

and use this css

    body {
  counter-reset: section;                    /* Set the section counter to 0 */
}

.custompagenumber::before {
    text-align: center;
    color: red;
  counter-increment: section;                /* Increment the section counter*/
  content: "(" counter(section) ")"; /* Display the counter */
}
ali johar
  • 13
  • 5
  • Of course it does if you mean you load them one by one ... do you load them one by one? – Asons Nov 13 '16 at 17:40
  • CSS is for setting presentational styles, not logic operations. – TylerH Nov 13 '16 at 17:41
  • @LGSon yes i load it one by one – ali johar Nov 13 '16 at 17:44
  • Then you need to count it in some other way, maybe server side to make it user independent, or i.e. localStorage (per user) – Asons Nov 13 '16 at 17:50
  • @TylerH right ... any way to do it using script or JS ? – ali johar Nov 13 '16 at 20:32
  • @alijohar Try searching: http://stackoverflow.com/questions/29232134/how-to-get-the-count-of-file-in-a-directory-using-jquery ; http://stackoverflow.com/questions/1266004/count-number-of-files-in-a-folder-through-javascript ; http://stackoverflow.com/questions/11489738/how-do-i-count-files-in-a-directory-using-jquery – TylerH Nov 14 '16 at 14:38

0 Answers0