Quote:
Originally Posted by hobnail
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;
}