View Single Post
Old 09-23-2022, 04:42 AM   #4
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: 68,651
Karma: 113245921
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 hobnail View Post
JSWolf's answer assumes that your CSS is using classes. My CSS only specifies html tags; e.g.,
Code:
body {
  font-size: 100%;
  border: 0;
  margin: 0;
  padding: 0;
  width: auto;
}

body * {
  line-height: inherit;
}

p {
  font-size: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  text-indent: 2em;
}

a {
  color: inherit;
  text-decoration: none;
}

h1,h2,h3,h4 {
  text-align: center;
}

.bold {
  font-weight: bold;
}

.italic {
  font-style: italic;
}

.bold_italic {
  font-weight: bold;
  font-style: italic;
}

img {
  margin-left: auto;
  margin-right: auto;
  max-width: 100%;
  border: none;
}
There's a problem with your CSS. Most eBooks do not specify a text-indent in <p>. So that means that in some cases, where there is a center, the center may be off to the right by the amount of the indent. Also, when the text is supposed to have no indent, it could have an indent. YOu also have to go through the CSS and make sure all centers and a text indent of 0 and that any code that assumes no text indent also have a text indent of 0.

Another thing that I see is not done (but if you like it, OK) is there is no widows and orphans of 1 to turn them off. Even if your Kobo has them off, if you ever read this eBook with something that has them on, they will be on.

Quote:
Most of the time the epub was converted from the Kindle format. If it was an epub to begin with I do an epub to epub conversion so that calibre can clean the html, fixing inline styles and whatnot.
If the eBook is a KF8 eBook, I'll use KindleGen to convert to ePub and then I'll see how good or bad the code is. If it's bad enough, then I'll use Calibre to convert to ePub. If it's not bad enough, I'll work with the ePub from KindleGen. KindleGen takes the KF8's code and make and ePub out of it. It leaves the code as much alone as possible.

Last edited by JSWolf; 09-23-2022 at 04:46 AM.
JSWolf is offline   Reply With Quote