View Single Post
Old 09-29-2020, 02:11 PM   #53
hobnail
Running with scissors
hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.
 
Posts: 1,590
Karma: 14328510
Join Date: Nov 2019
Device: none
Quote:
Originally Posted by Tex2002ans View Post
For a basic Fiction book, you barely need any CSS classes.
For the sake of an example here's the CSS I use when fixing / cleaning the CSS in a book I've bought. I do this in Sigil; I first create an empty css file and move the book's CSS into that file, so now the book's css file is empty. I have a Sigil clip which gets put in that empty file which is

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;
}

hr {
border-style: none;
margin-left: auto;
margin-right: auto;
margin-top: 1em;
page-break-after: avoid;
break-after: avoid;
background-color: hsl(0, 0%, 55%);
height: 1px;
width: 6em;
}

.italic {
font-style: italic
}

That doesn't properly format chapter headings that used p tags instead of h tags but I can live with that. What I want is a consistent text size, consistent line-height, consistent indentation, consistent minimal borders, and consistent space between paragraphs (none). All of those things I can adjust on my Kobo (maybe not the interparagraph spacing). If you leave out text-align left/justified then that can be set how you like it on the Kobo. (Kindles aren't so flexible unfortunately.) I also have to go through the original CSS and find what class they're using for italic when they're using spans instead of i or em tags and add it to that italic class. The book's html is left untouched so whatever crud is there remains (divs and spans usually).

It's rather a bit of a sledge hammer approach but it works well with the minimum amount of effort.

Last edited by hobnail; 09-29-2020 at 02:33 PM.
hobnail is offline   Reply With Quote