View Single Post
Old 07-17-2020, 03:49 PM   #6
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,796
Karma: 146391129
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
Analyze the html; see if there is a css class used for the body paragraphs. And a css class for a div that wraps the entire chapter (or occasionally a section tag instead of a div). And a css class for the body tag. If there is then delete its line-height. Those are the first things I fix in a bought book. What I really do is delete those classes from the html with a search and replace on all of the html files; e.g. <body class="calibre"> becomes <body>. After that I append at the end of their stylesheet(s):
Code:
body {
    font-size: 100%;
    border: 0;
    line-height: 1.2;
    margin: 0;
    padding: 0;
    width: auto;
}
body * {
    line-height: inherit;
}
p {
    font-size: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    text-indent: 2em;
}
The second body thing, with the asterisk, says that anything that's a child of the body tag, presumably everything, inherits its line-height from the body tag; that might be a good thing to try.
Change the code you posted to the code below. It's the code I use and it works very well. Also, I use the Calibre editor feature to remove unused CSS. Then I remove all line-height.

Code:
body {
  widows: 1;
  orphans: 1;
  margin-top: 0;
  margin-right: 0;
  margin-bottom: 0;
  margin-left: 0;
  text-align: justify;
}
p {
  margin-top: 0;
  margin-bottom: 0;
  text-indent: 1.2em;
}
JSWolf is offline   Reply With Quote