View Single Post
Old 03-23-2016, 10:21 AM   #10
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 79,891
Karma: 146918083
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Quote:
Originally Posted by theducks View Post
Reverse Engineer it Look at the code
(this is from a Project Gutenberg book)

Code:
<h2 id="pgepubid00004"><a id="Chapter_I"></a><a id="Page_5"></a>Chapter I</h2>
  <h3 id="pgepubid00005">PERFUMED PLANET</h3>
In this case there is no class=

So we will apply it to (ALL) H2 instead in the CSS


Code:
h1, h2, h3, h4, h5, h6 {
    text-align: center;
    /* all headings centered */
    clear: both;
page-break-before: always;
}
As you can imagine, applying to every H2 might be sub optimal
in many case there would be a class="<something>" associated with those particular H2
so you would find
.<something> {
or
it might be h2.<something> {
and put it there
I have a better way of doing headers.

CSS:
Code:
h2 {
text-align: center;
margin-top: 1em;
margin-bottom: 1em
}
HTML:
Code:
<h2>Chapter 1</h2>
JSWolf is offline   Reply With Quote