Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Editor

Notices

Reply
 
Thread Tools Search this Thread
Old 04-15-2022, 11:20 PM   #1
enuddleyarbl
Guru
enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.
 
enuddleyarbl's Avatar
 
Posts: 734
Karma: 1077122
Join Date: Sep 2013
Device: Kobo Forma
Some Decent stylesheet.css files?

I'm just starting to learn how to work with the editor and fix up the CSS in some of my purchased books. I'd appreciate it if people would post what they think are good, all-around useful styles that they use for their books. Mine are in stylesheet.css, but I've seen individual styles and Page styles floating around in the Styles section of the Editor.

EDIT: Since I started this thread all those months ago, I've found quite a bit of interesting information about this kind of thing (most of it over on MobileRead's epub forum). So, for completeness, I'll include my current set of classes that I use to replace everything in my purchased books' CSS. I guess my list is no longer "basic," but it's what I use and most of it will disappear after running the Calibre editor's Tools > Remove Unused CSS Rules option:
Code:
@page {
  margin-top: 0;
  margin-left: 0;
  margin-right: 0;
  margin-bottom: 0;
}
body {
/* Basic Styling for BODY Section of a File */
	height:	100%;
	margin:	0;
	orphans:	1;
	padding:	0;
	widows:	1;
}
* + *	{
/* Lobotomized Owl Selector - what to do any time two objects follow each other - limit to margin-top */
  margin-top:	0.6em;
}
p {
/* Basic paragraph styling */
	display: block;
	text-indent: 1.2em;
}
h1, h2, h3, h4 {
/* Basic Chapter Heading Styling */
  page-break-before: always;
  page-break-after: avoid;
  text-align: center;
}
h1 + p, h2 + p, h3 + p, h4 + p, hr + p, ol + p, ul + p, .chapquote + p, .headline + p, .letter + p, .note + p, .poem + p, .placard + p, .song + p	{
/* Non-indented Paragraphs Styling (for paragraphs that follow something and shouldn't be indented) */
  text-indent: 0;
}
h1 + p::first-letter, h2 + p::first-letter, h3 + p::first-letter, h4 + p::first-letter, hr + p::first-letter, .chapquote + p::first-letter	{
/* First-Letter Styling (for the first letter following certain things (IOW, dropcaps)) */
  font-weight: bold;
}
h2 + p::first-line, h3 + p::first-line, h4 + p::first-line, hr + p::first-line, .chapquote + p::first-line	{
/* Make first line of first paragraphs smallcap */
	font-size:	1.05em;
	font-variant:	small-caps;
}
hr {
/* Thematic break to use 3 asterisks between parts of story */
  margin-top: 0.9em;
  margin-bottom: 0.9em;
  border: none;
}
hr::before {
  content: "***";
  display: block;
  text-align: center;
}
blockquote	{
/* Blockquote Styling */
	display: block;
	font-size:	small;
	font-style: italic;
	margin-left: 1.7em;
	margin-right: 1.7em;
}
i > i	{
/*	Italics Child Selector Styling (Make Nested Italics Normal Font)	*/
	font-style:	normal;
}
i > em	{
/*	Italics Child Selector Styling (Make Nested Italics Normal Font)	*/
	font-style:	normal;
}
li	{
	margin-top:	0em;
}

/*
 * This whole section is styling for specific page types of a book
*/
section.aboutauthorpage {
/* About the Author Page Styling */
	font-size:	small;
	margin-left:	5%;
	margin-right: 5%;
}
section.acknowledgmentspage	{
/* Acknowledgments Page Styling */
	font-size:	small;
	margin-left:	5%;
	margin-right: 5%;
	text-align:	center;
}
section.acknowledgmentspage	p	{
/* Acknowledgments Page Paragraph Styling */
	display:	block;
	text-indent:	0;
}
section.alsobypage	{
/* Also By Page Styling */
	font-size:	small;
	margin-left:	5%;
	margin-right: 5%;
	text-align:	center;
}
section.alsobypage	p	{
/* Also By Page Paragraph Styling */
	display:	block;
	text-indent:	0;
}
section.bibliographypage {
/* Bibliography Page Styling */
	font-size:	small;
	margin-left:	2em;
	margin-right: 2em;
	text-align: left;
}
section.bibliographypage p {
/* Bibliography Page Paragraph Styling */
	display:	block;
	text-indent: -2em;
}
section.copyrightpage	{
/* Copyright Page Styling */
	font-size:	small;
	margin-left:	5%;
	margin-right: 5%;
	text-align:	center;
}
section.copyrightpage	p	{
/* Copyright Page Paragraph Styling */
	display:	block;
	text-indent:	0;
}
section.dedicationpage	{
/* Dedication Page Styling */
	font-size:	small;
	font-style:	italic;
	margin-left:	5%;
	margin-right: 5%;
	text-align:	center;
}
section.dedicationpage	p	{
/* Dedication Page Paragraph Styling */
	display:	block;
	text-indent:	0;
}
section.dramatispage {
/* Dramtis Personae Page Styling */
	font-size:	small;
	margin-left:	5%;
	margin-right:	5%;
	padding: 1.5em;
	text-align: justify;
}
section.dramatispage	p	{
/* Dramatis Personae Paragraph Style */
	display:	block;
	text-indent: -1.5em;
}
section.dramatispage .person {
/* Dramatis Personae Person Line Style */
	font-variant:	small-caps;
	font-weight: bold;
}

section.drmpage	{
/* DRM Statement Page Styling */
	font-size:	small;
	margin-left:	5%;
	margin-right:	5%;
	text-align:	center;
}
section.drmpage p	{
/* DRM Statement Page Paragraph Styling */
	display:	block;
	text-indent: 0;
}
section.epigraphpage	{
/* Epigraph Page Styling */
	font-size:	small;
	margin-left:	15%;
	margin-right: 15%;
}
section.epigraphpage	p	{
/* Epigraph Page Paragraph Styling */
	display:	block;
	text-indent:	0;
}
section.epigraphpage	p.signature {
/* Epigraph Page Signature styling (basically right-justify) */
	display:	block;
	text-align:	right;
}

section.glossarypage {
/* Glossary Page Styling */
	font-size:	small;
	margin-left:	5%;
	margin-right: 5%;
	padding: 1.5em;
	text-align: justify;
}
section.glossarypage	p	{
/* Glossary Page Paragraph Entry Styling */
	display:	block;
	text-indent: -1.5em;
}
section.glossarypage .term {
/* Glossary Term to be Defined Style */
	font-variant:	small-caps;
	font-weight: bold;
}

section.mappage	{
/* Map Page Styling */
	font-size:	small;
	margin-left:	5%;
	margin-right:	5%;
	text-align:	center;
}
section.mappage p {
/* Map Page Paragraph Styling */
	display:	block;
	text-indent:	0;
}

section.playact {
  /*	Play Act Section Styling	*/
  display: block;
}
section.playact div.playline {
  display: flex;
}
section.playact p {
  /* Play Act Paragraph Styling */
  display: block;
  text-indent: 0;
}
section.playact dd.dialog {
  /*	Play Act Dialog Styling for Description List <dl>	*/
  display: block;
  padding-left: 2px;
  text-align: left;
  vertical-align: top;
}
section.playact p.dialog {
  /*	Play Act Dialog Styling for Paragraph <p>	*/
  display: inline-block;
  margin-bottom:	0;
  margin-top:	0;
  padding-left: 2px;
  text-align: left;
  vertical-align:	top;
  width: 65%;
}
section.playact td.dialog {
  /*	Play Act Dialog Styling for Table <td>	*/
  border: 0;
  display: table-cell;
  padding-bottom: 2px;
  padding-left: 2px;
  padding-right: 2px;
  padding-top: 2px;
  text-align: left;
  vertical-align: top;
}
section.playact dt.person {
  /*	Play Act Person Styling for Description List <dl>	*/
  display: block;
  font-variant: small-caps;
	font-weight: bold;
  padding-right: 2px;
  text-align: left;
  vertical-align: top;
}
section.playact p.person {
  /*	Play Act Person Styling for Paragraph <p>	*/
  display: inline-block;
  font-variant: small-caps;
	font-weight: bold;
  margin-bottom:	0;
  margin-top:	0;
  padding-right: 2px;
  text-align: right;
  vertical-align:	top;
  width: 30%;
}
section.playact td.person {
  /*	Play Act Person Styling for Table <td>	*/
  border: 0;
  display: table-cell;
  font-variant: small-caps;
	font-weight: bold;
  padding-bottom: 2px;
  padding-left: 2px;
  padding-right: 2px;
  padding-top: 2px;
  text-align: left;
  vertical-align: top;
}
section.playact span.person {
  /*	Play Act Person Styling for Span <span>	*/
  display: inline-block;
	font-weight: bold;
  margin-top: 0;
  padding-right: 0%;
  font-variant: small-caps;
  vertical-align: top;
}
section.playact .person::after {
  /*	Append Colon After Play Act Person for Anything	*/
  content: ":";
}
section.playact span.person::after {
  /*	Don't Put Anything After Play Act Person for Span <span>	*/
  content: "";
}
section.playact dd.stage_direction {
  /*	Play Act Stage Direction Styling for Description List <dd>	*/
	display: block;
	font-family: sans-serif;
	font-style: italic;
	padding-left: 2px;
	text-align: left;
	vertical-align: top;
}
section.playact p.stage_direction {
  /*	Play Act Stage Direction Styling for Paragraph <p>	*/
  display: inline-block;
	font-family: sans-serif;
  font-style: italic;
  margin-bottom:	0;
  margin-top:	0;
  padding-left: 2px;
  text-align: left;
  vertical-align: top;
  width: 65%;
}
section.playact td.stage_direction {
  /*	Play Act Stage Direction Styling for Table <td>	*/
  border: 0;
  display: table-cell;
	font-family: sans-serif;
  font-style: italic;
  padding-bottom: 2px;
  padding-left: 2px;
  padding-right: 2px;
  padding-top: 2px;
  text-align: left;
  vertical-align: top;
}
section.playact span.stage_direction {
  /*	Play Act Stage Direction Styling for Spans <span>	*/
  display: inline-block;
	font-family: sans-serif;
  font-style: italic;
  padding-left: 0;
  text-align: left;
  vertical-align: top;
}
section.playact .stage_direction::before {
  /*	Prepend Opening Parenthesis Before Play Act Stage Directions	*/
  content: "(";
}
section.playact .stage_direction::after {
  /*	Append Closing Parenthesis After Play Act Stage Directions	*/
  content: ")";
}

section.playasparagraph {
  /*	Play Act Section as Paragraphs Styling	*/
	display: block;
	padding: 1.5em;
}
section.playasparagraph p {
  /* Play Act as Paragraphs Paragraph Styling */
	display: block;
	text-indent: -1.5em;
}
section.playasparagraph span.person {
  /*	Play Act as Paragraphs Person Styling for Span <span>	*/
	font-weight: bold;
	margin-top: 0;
	font-variant: small-caps;
	vertical-align: top;
}
section.playasparagraph span.stage_direction {
  /*	Play Act as Paragraphs Stage Direction Styling for Spans <span>	*/
	font-family: sans-serif;
	font-style: italic;
	padding-left: 0;
	text-align: left;
	vertical-align: top;
}
section.playasparagraph .stage_direction::before {
  /*	Prepend Opening Parenthesis Before Play Act as Paragraphs Stage Directions	*/
	content: "(";
}
section.playasparagraph .stage_direction::after {
  /*	Append Closing Parenthesis After Play Act Paragraphs Stage Directions	*/
	content: ")";
}

section.titlepage {
/* Title Page Styling */
	margin-left:	5%;
	margin-right:	5%;
	text-align:	center;
}
section.titlepage	p	{
/* Title Page Paragraph Styling */
	display:	block;
	text-indent:	0;
}
/*
 * This is a section for types of chunks on a page
*/
div.box {
/* Box That Encloses Text on All Sides */
	border-bottom-color:	#000;
	border-bottom-style:	solid;
	border-bottom-width:	0.1em;
	border-left-color:	#000;
	border-left-style:	solid;
	border-left-width:	0.1em;
	border-right-color:	#000;
	border-right-style:	solid;
	border-right-width:	0.1em;
	border-top-color:	#000;
	border-top-style:	solid;
	border-top-width:	0.1em;
	display:	block;
	padding-bottom:	1.5em;
	padding-left:	1.5em;
	padding-right:	1.5em;
	padding-top:	1.5em;
	text-align:	justify;
}
div.box	p	{
/* Box Text Styling */
	display: block;
	font-size: 0.88rem;
	text-align: justify;
	text-indent: 0;
}

div.chapquote {
/* Chapter Quote (quote at top of chapters) Styling */
  display: block;
  font-style:	italic;
  margin-left:	1em;
  margin-right:	1em;
  padding: 1em;
  text-align: justify;
}
div.chapquote	p	{
/* Chapter Quote Paragraph Styling */
	display:	block;
	font-size:	small;
	text-indent: 0;
}
div.chapquote	p.blockindent	{
/* Chapter Quote Paragraph Styling */
	display:	block;
	margin-left:	1.2em;
	text-indent: 0;
}
div.chapquote	p.blockindent2	{
/* Chapter Quote Paragraph Styling */
	display:	block;
	margin-left:	2.4em;
	text-indent: 0;
}
div.chapquote	p.signature {
/* Chapquote Signature styling (basically right-justify) */
	display:	block;
	text-align:	right;
}

div.diary	{
/* Diary Styling */
	display: block;
	font-size:	.88em;
	font-style:	italic;
	margin-left:	2em;
	margin-right:	2em;
	text-align:	left;
}
div.diary p	{
/* Diary Entry Paragraph Style */
	display:	block;
	text-indent:	0;
}
div.diary p.heading {
/* Diary Entry Heading */
	display:	block;
	text-align:	center;
}
div.diary p.date {
/* Diary Entry Date */
	display:	block;
	text-align:	right;
}
div.diary p.indented {
/* Diary Entry Entirely Indented Paragraph */
	display:	block;
	margin-left:	2em;
}

div.email	{
/* Email Styling */
	display: block;
	font-size:	.88em;
	font-style:	italic;
	margin-left:	2em;
	margin-right:	2em;
	text-align:	left;
}
div.email	p	{
/* Email Paragraph Styling */
	display:	block;
	margin-bottom:	0;
	text-indent:	0em;
}
div.email	p.heading {
/* Email Heading (Usually Address in Formal Letter) */
	display:	block;
	text-align:	left;
}
div.email p.indented {
/* Email Entirely Indented Paragraph */
	display:	block;
	margin-left:	2em;
}
div.email	p.salutation {
/* Email Salutation Line */
	display:	block;
	text-align:	left;
	text-indent:	0;
}
div.email	p.signature {
/* Email Signature styling (basically right-justify) */
	display:	block;
	text-align:	right;
}

div.letter	{
/* Letter Styling */
	display: block;
	font-size:	.88em;
	margin-left:	2em;
	margin-right:	2em;
	text-align:	left;
}
div.letter	p	{
/* Letter Paragraph Styling */
	display:	block;
	text-indent:	1.2em;
}
div.letter	p.heading {
/* Letter Heading (Usually Address in Formal Letter) */
	display:	block;
	text-align:	right;
}
div.letter	p.salutation {
/* Letter Salutation Line */
	display:	block;
	text-align:	left;
	text-indent:	0;
}
div.letter	p.signature {
/* Letter Signature styling (basically right-justify) */
	display:	block;
	text-align:	right;
}

div.news {
/* News Article Styling */
  display: block;
  font-style:	italic;
  margin-left:	1em;
  margin-right:	1em;
  padding: 1em;
  text-align: justify;
}
div.news	p	{
/* News Article Paragraph Styling */
	display:	block;
	font-size:	small;
	text-indent: 0;
}
div.news	p.blockindent	{
/* News Article Paragraph Styling */
	display:	block;
	margin-left:	1.2em;
	text-indent: 0;
}
div.news	p.blockindent2	{
/* News Article Paragraph Styling */
	display:	block;
	margin-left:	2.4em;
	text-indent: 0;
}
div.news	p.headline {
/* News Article Styling for a headline */
	display:	block;
	font-weight: bold;
	padding-bottom: 0.6em;
	padding-top: 0.6em;
	text-align: center;
	text-indent: 0em;
}
div.news	p.signature {
/* News Article Signature styling (basically right-justify) */
	display:	block;
	text-align:	right;
}

div.note	{
/* Note Styling */
	display: block;
	font-size:	.88em;
	margin-left:	2em;
	margin-right:	2em;
	text-align:	left;
}
div.note p	{
/* Note Paragraph Style */
	display:	block;
	text-indent:	0;
}
div.note p.center {
/* Note Heading */
	display:	block;
	text-align:	center;
}
div.note p.heading {
/* Note Heading */
	display:	block;
	text-align:	right;
}
div.note p.indented {
/* Note Entirely Indented Paragraph */
	display:	block;
	margin-left:	2em;
}

div.play {
  /*	Play Act Div as Paragraphs Styling	*/
	display: block;
	margin-left:	2em;
	margin-right:	2em;
	padding: 1.5em;
}
div.play p {
  /* Play Act as Paragraphs Paragraph Styling */
	display: block;
	text-indent: -1.5em;
}
div.play span.person {
  /*	Play Act as Paragraphs Person Styling for Span <span>	*/
	font-weight: bold;
	margin-top: 0;
	font-variant: small-caps;
	vertical-align: top;
}
div.play p.stagedirection {
  /*	Play Act as Paragraphs Stage Direction Styling for Paragraphs <p>	*/
	font-family: sans-serif;
	font-style: italic;
	padding-left: 0;
	text-align: left;
	vertical-align: top;
}
div.play span.stagedirection {
  /*	Play Act as Paragraphs Stage Direction Styling for Spans <span>	*/
	font-family: sans-serif;
	font-style: italic;
	padding-left: 0;
	text-align: left;
	vertical-align: top;
}
div.play .stagedirection::before {
  /*	Prepend Opening Parenthesis Before Play Act as Paragraphs Stage Directions	*/
	content: "(";
}
div.play .stagedirection::after {
  /*	Append Closing Parenthesis After Play Act Paragraphs Stage Directions	*/
	content: ")";
}

div.poem {
/* Poem Styling */
	display: block;
	font-size:	.88em;
    font-style: italic;
	margin-left:	2em;
	margin-right:	2em;
	padding-left:	1.5em;
	text-align:	left;
}
div.poem p {
/* Poem Paragraph Styling */
	display:	block;
	margin-top:	0;
	margin-bottom:	0;
	text-indent:	-1.5em;
}
div.poem p.first {
/* Poem First Line */
	display:	block;
	padding-top:	1em;
}
div.poem p.indented {
/* Poem Entirely Indented Stanza */
	display:	block;
	margin-left:	2em;
}
div.poem p.last {
/* Poem Last Line */
	display:	block;
	padding-bottom:	1em;
}

div.song {
/* Song Styling */
	display: block;
	font-size:	.88em;
    font-style: italic;
	font-weight:	bold;
	margin-left:	2em;
	margin-right:	2em;
	padding-left:	1.5em;
	text-align:	left;
}
div.song p {
/* Song Paragraph Styling */
	display:	block;
	margin-top:	0;
	margin-bottom:	0;
	text-indent:	-1.5em;
}
div.song p.first {
/* Song First Line */
	display:	block;
	padding-top:	1em;
}
div.song p.indented {
/* Song Entirely Indented Stanza */
	display:	block;
	margin-left:	2em;
}
div.song p.indented2 {
/* Song Entirely Indented Stanza */
	display:	block;
	margin-left:	4em;
}
div.song p.indented3 {
/* Song Entirely Indented Stanza */
	display:	block;
	margin-left:	6em;
}
div.song p.last {
/* Song Last Line */
	display:	block;
	padding-bottom:	1em;
}

div.transcript	{
/* Conversation Transcript Styling */
	display: block;
	font-size:	.88em;
	margin-left:	2em;
	margin-right:	2em;
	padding: 1.5em;
	text-align:	left;
}
div.transcript	p	{
/* Conversation Transcript Paragraph Styling */
	display:	block;
	margin-bottom:	0;
	text-indent:	-1.5em;
}
div.transcript	p.heading {
/* Conversation Transcript Heading (Usually Address in Formal Letter) */
	display:	block;
	text-align:	left;
}
div.transcript p.indented {
/* Conversation Transcript Entirely Indented Paragraph */
	display:	block;
	margin-left:	2em;
}
div.transcript span.person {
  /*	Play Act as Paragraphs Person Styling for Span <span>	*/
	font-weight: bold;
	margin-top: 0;
	font-variant: small-caps;
	vertical-align: top;
}
div.transcript	p.salutation {
/* Conversation Transcript Salutation Line */
	display:	block;
	text-align:	left;
	text-indent:	0;
}
div.transcript	p.signature {
/* Conversation Transcript Signature styling (basically right-justify) */
	display:	block;
	text-align:	left;
}

/*
 * A styling section for things that apply everywhere
*/
.bold {
/* Bold Styling */
	font-weight: bold;
}

.caption {
/* Caption Styling for an Image */
	display:	block;
	font-size: 0.8em;
	font-weight: bold;
	padding-bottom: 0.6em;
	padding-top: 0em;
	text-align: center;
	text-indent: 0em;
}

.center {
/* Centered Text Styling */
	display:	block;
	text-align: center;
	text-indent: 0;
}

.dotleaderline	{
/* Turns a block into a flexbox so it can be "responsive" */
	align-items:	flex-end;
	display:	flex;
	flex-direction:	row;
	flex-wrap:	nowrap;
	justify-content:	center;
	text-indent: 0em;
}
.dotleaderline span {
/* Put some space between the spanned objects in the dotleaderline */
  padding-top:	0em;
  padding-right:	1.25em;
  padding-bottom:	0em;
  padding-left:	1.25em;
}
.dotfiller	{
/* Stuck between two objects in a flexbox, will fill the gap with dots */
	flex-grow:	1;
	border-bottom:	0.1em dotted;
	min-width:	1.2em;
}

.firstletter::first-letter	{
/* First Letter of paragraph Styling (i.e., dropcap) */
	font-weight: bold;
}

.footnote {
/* Footnote Styling */
  font-family: sans-serif;
  font-size: 0.7em;
  padding-top: 0.1em;
  padding-bottom: 0.1em;
  margin-left: 4em;
  margin-right: 4em;
  text-indent: 0;
  border-top: 1px solid black;
  border-bottom: 1px solid black;
  page-break-inside: avoid;
} 

.hanging	{
/* Hanging indent styling */
	display:	block;
	margin-left:	2em;
	text-indent: -2em;
}

.headline {
/* Styling for a headline */
	display:	block;
	font-size: 0.88em;
	font-weight: bold;
	padding-bottom: 0.6em;
	padding-top: 0.6em;
	text-align: center;
	text-indent: 0em;
}

.img90width {
  /* Image class to to take up 90% of the screen width */
  width: 90%;
  max-height: 100%;
  max-width: 100%;
}
.imgchaptitlewidth	{
/* Image class to set an image's percentage of screen width */
	width:	25%;
	max-height:	100%;
	max-width:	100%;
}
.imgfull {
/* Image class to take up 90% of the screen height */
	height:	90%;
	max-height:	100%;
	max-width:	100%;
}
.imgsetwidth	{
/* Image class to set an image's percentage of screen width */
	width:	25%;
	max-height:	100%;
	max-width:	100%;
}

.indent {
/* Indented paragraph styling */
	display:	block;
	text-indent: 1.2em;
}

.italic {
/* Italic Styling */
    font-style: italic;
}

.listitem {
/* Class that acts as li element */
	display: list-item;
	list-style-type: none;
	margin-left:	1.2em;
	margin-right: 1.2em;
	padding-left: 1.5em;
	text-indent:	-1.5em;
}

.loud {
/* Loud, Shouting Style */
	display:	block;
	font-size:	1.5em;
	font-weight:	bold;
	padding-bottom:	0.83em;
	padding-top:	0.83em;
}

.noindent {
/* Non-indented paragraph styling */
	display:	block;
	text-indent: 0;
}

.normal {
/* Class to strip off styling - put in a span */
  font-style: normal;
  font-variant:	normal;
  font-weight: normal;
  text-decoration: none;
}

.ol_arabic {
/* Ordered List Class for Arabic Numbers (Safer to use UL) */
	display: block;
	list-style-type: decimal;
	margin-left:	1.2em;
	margin-right: 1.2em;
}
.ol_lowalpha {
/* Ordered List Class for Uppercase Alphabetic "Numbers" (Safer to use UL) */
	display: block;
	list-style-type: lower-alpha;
	margin-left:	1.2em;
	margin-right: 1.2em;
}
.ol_upalpha {
/* Ordered List Class for Uppercase Alphabetic "Numbers" (Safer to use UL) */
	display: block;
	list-style-type: upper-alpha;
	margin-left:	1.2em;
	margin-right: 1.2em;
}
.ol_uproman {
/* Ordered List Class for Uppercase Roman "Numerals" (Safer to us UL) */
	display: block;
	list-style-type: upper-roman;
	margin-left:	1.2em;
	margin-right: 1.2em;
}

.placard {
/* Styling for a placard */
	display:	block;
	font-size: 0.88em;
	font-weight: bold;
	padding-bottom: 0.6em;
	padding-top: 0.6em;
	text-align: center;
	text-indent: 0em;
}

.right {
/* Right-Justify styling */
	display:	block;
	text-align:	right;
}

.signature {
/* Signature styling */
	display:	block;
	text-align:	right;
}

.small {
/* Small font style */
	font-size: 0.75em;
}
.smaller {
/* Smaller font style */
	font-size: 0.6em;
}

.smallcaps {
/* Smallcaps styling (text should be typed normally and will be smallcapped) */
	font-variant: small-caps;
}

.strike {
	/*	Strike-through styling	*/
  text-decoration: line-through;
}

.subtitle {
/* Centered Text Styling */
	display:	block;
	text-align: center;
	text-indent: 0;
}

.tablestructure	{
/* Defines Structure for Whole Table, i.e. <table> */
	border:	0px black solid;
	border-collapse:	separate;
	border-spacing:	5px;
	display:	table;
	margin-bottom:	0;
	margin-top:	0;
	text-indent:	0;
	width:	100%;
}
.tabledatacell	{
/* Defines Structure for Table Data Cells, i.e. <td> */
	border:	0;
	display:	table-cell;
	padding-bottom:	2px;
	padding-left:	2px;
	padding-right:	2px;
	padding-top:	2px;
	text-align:	inherit;
	vertical-align:	top
}
.tableheaderrow	{
/* Defines Structure for Table Header, i.e. <th> */
	text-decoration: underline;
	vertical-align:	top;
}
.tablerow	{
/* Defines Structure for Table Row, i.e. <tr> */
	display:	table-row;
	vertical-align:	middle;
}
.tabletext {
  /* Hanging indent styling */
  display: block;
  margin-bottom:	0;
  margin-left: 2em;
  margin-top:	0;
  text-indent: -2em;
}

.telegram {
	/* Style to Approximate the Look of a Telegram Without a Monospace Font */
	display: block;
	font-family: sans-serif;
	font-variant:	small-caps;
	letter-spacing:	0.08em;
	margin-left:	2em;
	margin-right:	2em;
	text-indent: 0;
    }

.textbox {
/* Make a box around text (above and below it) */
	line-height: 1.3em;
	margin-bottom: 2em;
	margin-top: 2em;
	text-align: center;
	border-top: black solid 2px;
	border-bottom: black solid 2px;
}

p.textmessage {
  /* Status Styling for Single Line for Computer Screen Responses */
  display: block;
  font-size: 0.88em;
  font-weight: bold;
  margin-left: 2em;
  margin-right: 2em;
  text-align: left;
  text-indent: 0;
}
span.textmessage {
  /* Status Styling for Single Line for Computer Screen Responses */
  font-size: 0.88em;
  font-weight: bold;
}

.ul_circle {
/* Unordered List Open Circle Bullet */
	display: block;
	list-style-type: circle;
	margin-left:	1.2em;
	margin-right: 1.2em;
}
.ul_disc	{
/* Unordered List Filled Circle Bullet */
	display: block;
	list-style-type: disc;
	margin-left:	1.2em;
	margin-right: 1.2em;
}
.ul_none	{
/* Unordered List No Bullet */
	display: block;
	list-style-type: none;
	margin-left:	1.2em;
	margin-right: 1.2em;
	padding-left: 1.5em;
	text-indent:	-1.5em;
}
.ul_square	{
/* Unordered List Filled Square Bullet */
	display: block;
	list-style-type: square;
	margin-left:	1.2em;
	margin-right: 1.2em;
}

.underline {
/* Underline Styling */
	text-decoration: underline;
}
/*
 * Stuff Unique to Particular Books
 * Running "Remove Unused CSS Rules" Will Remove Unnecessary Stuff
*/

.worry {
  font-size: 0.88rem;
  font-style: italic;
}

div.galsix {
/* galsix Styling for Brin's Uplift Books */
	display: block;
	font-size:	.88em;
    font-style: italic;
	margin-left:	2em;
	margin-right:	2em;
	padding-left:	1.5em;
	text-align:	left;
}
div.galsix p {
/* galsix Paragraph Styling for Brin's Uplift Books */
	display:	block;
	margin-top:	0;
	margin-bottom:	0;
	text-indent:	-1.5em;
}
div.galsix p.first {
/* galsix First Line for Brin's Uplift Books */
	display:	block;
	padding-top:	1em;
}
div.galsix p.indented {
/* galsix Entirely Indented Stanza for Brin's Uplift Books */
	display:	block;
	margin-left:	2em;
}
div.galsix p.last {
/* galsix Last Line for Brin's Uplift Books */
	display:	block;
	padding-bottom:	1em;
}

div.galthree {
/* galthree Styling for Brin's Uplift Books */
	display: block;
	font-size:	.88em;
    font-style: italic;
	margin-left:	2em;
	margin-right:	2em;
	padding-left:	1.5em;
	text-align:	left;
}
div.galthree p {
/* galthree Paragraph Styling for Brin's Uplift Books */
	display:	block;
	margin-top:	0;
	margin-bottom:	0;
	text-indent:	-1.5em;
}
div.galthree p.first {
/* galthree First Line for Brin's Uplift Books */
	display:	block;
	padding-top:	1em;
}
div.galthree p.indented {
/* galthree Entirely Indented Stanza for Brin's Uplift Books */
	display:	block;
	margin-left:	2em;
}
div.galthree p.last {
/* galthree Last Line for Brin's Uplift Books */
	display:	block;
	padding-bottom:	1em;
}

div.galtwo {
/* galtwo Styling for Brin's Uplift Books */
	display: block;
	font-size:	.88em;
    font-style: italic;
	margin-left:	2em;
	margin-right:	2em;
	padding-left:	1.5em;
	text-align:	left;
}
div.galtwo p {
/* galtwo Paragraph Styling for Brin's Uplift Books */
	display:	block;
	margin-top:	0;
	margin-bottom:	0;
	text-indent:	-1.5em;
}
div.galtwo p.first {
/* galtwo First Line for Brin's Uplift Books */
	display:	block;
	padding-top:	1em;
}
div.galtwo p.indented {
/* galtwo Entirely Indented Stanza for Brin's Uplift Books */
	display:	block;
	margin-left:	2em;
}
div.galtwo p.last {
/* galtwo Last Line for Brin's Uplift Books */
	display:	block;
	padding-bottom:	1em;
}

div.kiqui {
/* kiqui Styling for Brin's Uplift Books */
	display: block;
	font-size:	.88em;
    font-style: italic;
	margin-left:	2em;
	margin-right:	2em;
	padding-left:	1.5em;
	text-align:	left;
}
div.kiqui p {
/* kiqui Paragraph Styling for Brin's Uplift Books */
	display:	block;
	margin-top:	0;
	margin-bottom:	0;
	text-indent:	-1.5em;
}
div.kiqui p::before {
  /* kiqui line starting character for Brin's Uplift Books */
  content:	"\:\?\: ";
}
div.kiqui p.first {
/* kiqui First Line for Brin's Uplift Books */
	display:	block;
	padding-top:	1em;
}
div.kiqui p.indented {
/* kiqui Entirely Indented Stanza for Brin's Uplift Books */
	display:	block;
	margin-left:	2em;
}
div.kiqui p.last {
/* kiqui Last Line for Brin's Uplift Books */
	display:	block;
	padding-bottom:	1em;
}

div.mulc {
/* mulc Styling for Brin's Uplift Books */
	display: block;
	font-size:	.88em;
    font-style: italic;
	margin-left:	2em;
	margin-right:	2em;
	padding-left:	1.5em;
	text-align:	left;
}
div.mulc p {
/* mulc Paragraph Styling for Brin's Uplift Books */
	display:	block;
	margin-top:	0;
	margin-bottom:	0;
	text-indent:	-1.5em;
}
div.mulc p.first {
/* mulc First Line for Brin's Uplift Books */
	display:	block;
	padding-top:	1em;
}
div.mulc p.indented {
/* mulc Entirely Indented Stanza for Brin's Uplift Books */
	display:	block;
	margin-left:	2em;
}
div.mulc p.last {
/* mulc Last Line for Brin's Uplift Books */
	display:	block;
	padding-bottom:	1em;
}

div.primal {
/* primal Styling for Brin's Uplift Books */
	display: block;
	font-size:	.88em;
    font-style: italic;
	margin-left:	2em;
	margin-right:	2em;
	padding-left:	1.5em;
	text-align:	left;
}
div.primal p {
/* primal Paragraph Styling for Brin's Uplift Books */
	display:	block;
	margin-top:	0;
	margin-bottom:	0;
	text-indent:	-1.5em;
}
div.primal p::before {
  /* primal line starting character for Brin's Uplift Books */
  content:	"# ";
}
div.primal p.first {
/* primal First Line for Brin's Uplift Books */
	display:	block;
	padding-top:	1em;
}
div.primal p.indented {
/* primal Entirely Indented Stanza for Brin's Uplift Books */
	display:	block;
	margin-left:	2em;
}
div.primal p.indented2 {
/* Primal 2nd Indented Stanza for Brin's Uplift Books */
	display:	block;
	margin-left:	4em;
}
div.primal p.last {
/* primal Last Line for Brin's Uplift Books */
	display:	block;
	padding-bottom:	1em;
}
div.primal p.last::after {
  /* primal last line ending character for Brin's Uplift Books */
  content:	" #";
}

div.trinary {
/* trinary Styling for Brin's Uplift Books */
	display: block;
	font-size:	.88em;
    font-style: italic;
	margin-left:	2em;
	margin-right:	2em;
	padding-left:	1.5em;
	text-align:	left;
}
div.trinary p {
/* trinary Paragraph Styling for Brin's Uplift Books */
	display:	block;
	margin-top:	0;
	margin-bottom:	0;
	text-indent:	-1.5em;
}
div.trinary p::before {
  /* trinary Line starting character for Brin's Uplift Books */
  content:	"* ";
}
div.trinary p.first {
/* trinary First Line for Brin's Uplift Books */
	display:	block;
	padding-top:	1em;
}
div.trinary p.indented {
/* trinary Entirely Indented Stanza for Brin's Uplift Books */
	display:	block;
	margin-left:	2em;
}
div.trinary p.indented2 {
/* trinary Twice Indented Stanza for Brin's Uplift Books */
	display:	block;
	margin-left:	4em;
}
div.trinary p.last {
/* trinary Last Line for Brin's Uplift Books */
	display:	block;
	padding-bottom:	1em;
}
div.trinary p.last::after {
  /* trinary last line ending character  for Brin's Uplift Books */
  content:	" *";
}

div.traeki {
/* traeki Styling for Brin's Uplift Books */
	display: block;
	font-size:	.88em;
    font-style: italic;
	margin-left:	2em;
	margin-right:	2em;
	padding-left:	1.5em;
	text-align:	left;
}
div.traeki p {
/* traeki Paragraph Styling for Brin's Uplift Books */
	display:	block;
	margin-top:	0;
	margin-bottom:	0;
	text-indent:	-1.5em;
}
div.traeki p.first {
/* traeki First Line for Brin's Uplift Books */
	display:	block;
	padding-top:	1em;
}
div.traeki p.indented {
/* traeki Entirely Indented Stanza for Brin's Uplift Books */
	display:	block;
	margin-left:	2em;
}
div.traeki p.last {
/* traeki Last Line for Brin's Uplift Books */
	display:	block;
	padding-bottom:	1em;
}

.jophur {
/* jophur styling for Brin's Uplift Books */
	font-variant: small-caps;
}

.oldones {
/* oldones styling for Brin's Uplift Books */
	display:	block;
	font-size: small;
	padding-left:	2.4em;
	padding-right:	2.4em;
	text-align: justify;
	text-indent:	0;
	text-transform: uppercase;
}

div.status {
  /* Status Styling for Computer Screen Responses */
  display: block;
  font-size: 0.88em;
  font-weight: bold;
  margin-left: 2em;
  margin-right: 2em;
  text-align: left;
}
div.status p {
  /* Status Paragraph Style for Computer Screen Responses */
  display: block;
  margin-top:	0;
  margin-bottom:	0;
  text-indent: 0;
}
div.status p.heading {
  /* Status Heading for Computer Screen Responses */
  display: block;
  text-align: right;
}
div.status p.indented {
  /* Status Entirely Indented Paragraph for Computer Screen Responses */
  display: block;
  margin-left: 2em;
}
p.status	{
  /* Status Styling for Single Line for Computer Screen Responses */
  display:	block;
  font-size:	0.88em;
  font-weight: bold;
  margin-left:	2em;
  margin-right:	2em;
  text-align:	left;
  text-indent:	0;
}
span.status	{
  /* Status Styling for Single Line for Computer Screen Responses */
  font-size:	0.88em;
  font-weight: bold;
}

.ai {
  /* Styling for Asher's AIs */
  display: block;
  font-size: 0.88em;
  font-variant: small-caps;
  margin-left: 2em;
  margin-right: 2em;
  text-align: left;
  text-indent: 0;
}
.death {
  /*	Styling for Pratchett's Death	*/
  text-transform: uppercase;
}
.dungeon {
  /*	Styling for Pratchett's Dungeon Dimension Creatures	*/
  text-transform: uppercase;
}
.demonreach {
  /*	Styling for Butcher's DemonReach	*/
  text-transform: uppercase;
}
.golem {
  /*	Styling for Pratchett's Golems	*/
	font-weight:	bold;
	text-transform:	uppercase;
}
.grandfathers {
  /*	Styling for Pratchett's Grandfathers in Nation	*/
  text-transform: uppercase;
}
.mrkindly	{
	/* Style for Mr. Kindly Cat in Kristoff's Nevernight */
	font-size:	0.83em;
	font-style:	italic;
	text-indent:	1.2em;
}
.ratking {
  /*	Styling for Pratchett's Ratking	*/
	font-weight:	bold;
	font-style:	italic;
}

Last edited by enuddleyarbl; 11-09-2023 at 11:27 AM. Reason: More Information
enuddleyarbl is offline   Reply With Quote
Old 04-16-2022, 01:05 AM   #2
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,552
Karma: 14325282
Join Date: Nov 2019
Device: none
With purchased books, what are your goals? Mine are to not have to change the font size, margin, and line spacing sliders when I open a book for the first time. To do that I remove the class on the body tag, on any div tag that may encompass the entire chapter, and on the body p tags. (A lot of books use p tags for the chapter titles so those I keep.) Often there are span tags just inside of the p tags so those need their class removed as well. I.e., search for class="calibre8" and replace it with nothing. I've recently started removing all font-size lines from the book's stylesheet. So even that typically small text on the copyright page becomes "normal" size. I also remove all line-height lines from the stylesheet. For novels this all works well since it's mostly just paragraphs of plain text. Then at the end of the book's stylesheet I add
Code:
body {
  font-size: 100%;
  border: 0;
  margin: 0;
  padding: 0;
  width: auto;
}

p {
  font-size: 100%;
  border: 0;
  margin: 0;
  padding: 0;
  text-indent: 2em;
}
One thing that tripped me up is that if the html has 'p class="something"' and you have css for an unadorned p like mine above at the end of the stylesheet, the p with a class takes precedence, regardless of its location in the stylesheet. So you can't just add css for unadorned tags at the bottom the file thinking that they'll override stuff above. Which is why I get out the buzz saw and remove classes from the html.
hobnail is offline   Reply With Quote
Advert
Old 04-16-2022, 01:09 AM   #3
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,552
Karma: 14325282
Join Date: Nov 2019
Device: none
It could also help to sort of regularize or normalize the html by doing a calibre conversion to the same format. E.g., azw3 to azw3 or epub to epub. And have various things set in calibre's conversion settings.
hobnail is offline   Reply With Quote
Old 04-16-2022, 09:36 AM   #4
enuddleyarbl
Guru
enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.
 
enuddleyarbl's Avatar
 
Posts: 734
Karma: 1077122
Join Date: Sep 2013
Device: Kobo Forma
Hopefully, I won't have to mess with a commercial book's css very often. But, I just went through a book and did so because I could see problems with the css upon trying to read the book:

https://www.mobileread.com/forums/sh...d.php?t=346218

There, I ended up removing most of the css and going with just a few, simple styles that I cobbled together. But, I don't really know what good styles should look like. In general, those suggestions sound good. These are simply novels and I'm happy to let the ereader (Kobo Forma) handle all the things like fonts, sizes, justifications, etc..

What about heading styles (h1, h2, etc.)? Do you leave them as default or do you adjust those?

Last edited by enuddleyarbl; 04-16-2022 at 09:55 AM.
enuddleyarbl is offline   Reply With Quote
Old 04-16-2022, 10:15 AM   #5
Thasaidon
Hedge Wizard
Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.
 
Thasaidon's Avatar
 
Posts: 801
Karma: 19999999
Join Date: May 2011
Location: UK/Philippines
Device: Kobo Touch, Nook Simple
Quote:
Originally Posted by DaveLessnau View Post
Hopefully, I won't have to mess with a commercial book's css very often. But, I just went through a book and did so because I could see problems with the css upon trying to read the book:

https://www.mobileread.com/forums/sh...d.php?t=346218

There, I ended up removing most of the css and going with just a few, simple styles that I cobbled together. But, I don't really know what good styles should look like. In general, those suggestions sound good. These are simply novels and I'm happy to let the ereader (Kobo Forma) handle all the things like fonts, sizes, justifications, etc..

What about header styles (h1, h2, etc.)? Do you leave them as default or do you adjust those?
A problem is what sort of look do you want the pages in your eBooks to have?

I started off with a lot of poorly formatted/coded ebooks many moons ago. In order to get the ebooks to look how I wanted, I had to learn the basics of CSS and editting the code.

I have my own CSS file which contains about 25 styles though often I end up only using four or five of these styles in an eBook CSS. I came up with the CSS and its' stylrs after looking at a lot of CSS files and reading Mobilrread. Forums. books on CSS and trying things out..

A stranger looking at a book I have reformatted may find my formatting style ugly, cack-handed and thoroughly horrible but I am totally unconcerned by this as the results suit me.

This being the case am not sure that having a CSS file from someone else would necessarily help you very much.
Thasaidon is offline   Reply With Quote
Advert
Old 04-16-2022, 11:36 AM   #6
enuddleyarbl
Guru
enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.
 
enuddleyarbl's Avatar
 
Posts: 734
Karma: 1077122
Join Date: Sep 2013
Device: Kobo Forma
Quote:
Originally Posted by Thasaidon View Post
... This being the case am not sure that having a CSS file from someone else would necessarily help you very much.
It's not the exact settings in the styles that I'm looking for. It's the type of styles and generally how they're set up. For instance, hobnail's two styles, above, have confirmed the kind of styles I've been coming up with: minimal and pretty general purpose. The specifics of the text-indent size (or whether I'd prefer a text-indent or margin-bottom) aren't really necessary. Or, another example would be his "font-size: 100%": instead of that, I've used "line-height: 1". So, now I know enough to go and compare those two and see if what I thought I was doing was what I actually ended up doing.

Just seeing what people think of as good would be a lot of help to me.
enuddleyarbl is offline   Reply With Quote
Old 04-16-2022, 11:55 AM   #7
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: 74,488
Karma: 129668758
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
What I do is delete any of the HTML files I don't want such as the HTML ToC, any review pages, list of author books, previews, adverts, etc. Then I remove excess CSS. I then add in
Code:
blockquote {
  margin-top: 1em;
  margin-right: 1.5em;
  margin-bottom: 1em;
  margin-left: 1.5em;
}
.blockquote {
  margin-top: 1em;
  margin-right: 1.5em;
  margin-bottom: 0;
  margin-left: 1.5em;
}
body {
  widows: 1;
  orphans: 1;
  margin-top: 0;
  margin-right: 0;
  margin-bottom: 0;
  margin-left: 0;
  text-align: justify;
}
img {
  max-height: 100%;
  max-width: 100%;
}
p {
  margin-top: 0;
  margin-bottom: 0;
  text-indent: 1.2em;
}
hr {
  margin-top: 1em;
  margin-right: 40%;
  margin-bottom: 0.9em;
  margin-left: 40%;
  border-top: 2px solid;
}
.cover {
  text-align: center;
  text-indent: 0;
  height: 100%;
}
blockquote is what I use to replace the fake blockquotes with. .blockquote is the blockquote class in case the blockquote ends at the end of the chapter/section. body is the body code. img is so the images do not overlap the screen. p is the default paragraph code. I remove the <p class="someuselessclass"> and change it with <p>. hr is for section breaks. <hr/> gives a 20% line and some space before and after. cover is the code I use for full screen cover and titlepages. <div class="cover"> and in the <img I also use class="cover".
JSWolf is offline   Reply With Quote
Old 04-16-2022, 01:14 PM   #8
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,552
Karma: 14325282
Join Date: Nov 2019
Device: none
Quote:
Originally Posted by DaveLessnau View Post
Hopefully, I won't have to mess with a commercial book's css very often. But, I just went through a book and did so because I could see problems with the css upon trying to read the book:

https://www.mobileread.com/forums/sh...d.php?t=346218

What about heading styles (h1, h2, etc.)? Do you leave them as default or do you adjust those?
For that liga error I'm guessing that converting it to the same format with calibre would have fixed it.

For the h1, etc. tags I center them but the sizes I leave alone. In the css I use for Project Gutenberg books I use the words with font-size; large, small, etc. The css that's built into the kobo gets almost everything right, except paragraphs aren't indented and have a blank line between them.
hobnail is offline   Reply With Quote
Old 04-16-2022, 02:13 PM   #9
enuddleyarbl
Guru
enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.
 
enuddleyarbl's Avatar
 
Posts: 734
Karma: 1077122
Join Date: Sep 2013
Device: Kobo Forma
Quote:
Originally Posted by JSWolf View Post
What I do is delete any of the HTML files I don't want such as the HTML ToC, any review pages, list of author books, previews, adverts, etc. Then I remove excess CSS. I then add in...
Thanks. I hadn't thought of deleting whole files that I didn't want. Plus, I was thinking of adding a blockquote style for one section of that book I was re-css-ing. Now I can use yours.
enuddleyarbl is offline   Reply With Quote
Old 04-16-2022, 02:51 PM   #10
DNSB
Bibliophagist
DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.
 
DNSB's Avatar
 
Posts: 36,320
Karma: 145735552
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
Quote:
Originally Posted by DaveLessnau View Post
What about heading styles (h1, h2, etc.)? Do you leave them as default or do you adjust those?
My standard to h1,h2 ... h5, h6 is to use h1 for books in a omnibus, h2 for parts inside a book and h3 for chapters inside the parts to allow a hierarchical ToC. I've used h4 & h5 for sections inside a chapter where the original ebook had such ToC entries but, for the most part, I don't see any real need for their use.

One ebook I worked on had 42 chapters that averaged 12 pages (Adobe synthetic page count numbers) with 17-24 sections in each chapter which made for a useless ToC with ~800 entries to scroll through.
DNSB is offline   Reply With Quote
Old 04-16-2022, 05:00 PM   #11
retiredbiker
Addict
retiredbiker ought to be getting tired of karma fortunes by now.retiredbiker ought to be getting tired of karma fortunes by now.retiredbiker ought to be getting tired of karma fortunes by now.retiredbiker ought to be getting tired of karma fortunes by now.retiredbiker ought to be getting tired of karma fortunes by now.retiredbiker ought to be getting tired of karma fortunes by now.retiredbiker ought to be getting tired of karma fortunes by now.retiredbiker ought to be getting tired of karma fortunes by now.retiredbiker ought to be getting tired of karma fortunes by now.retiredbiker ought to be getting tired of karma fortunes by now.retiredbiker ought to be getting tired of karma fortunes by now.
 
retiredbiker's Avatar
 
Posts: 389
Karma: 1638210
Join Date: May 2013
Location: Ontario, Canada
Device: Kindle KB, Oasis, Pop_Os!, Jutoh, Kobo Forma
I use this to make books read well in my Kobo Forma, without any fancy added fonts or anything. Just plain vanilla. This meets my needs, and as others have said somebody else will find it all ugly and wrong. Maybe once in 10 books I will go outside this for special formatting.

Code:
body {
  margin-top: 0.1em;
  margin-right: 0;
  margin-bottom: .1em;
  margin-left: 0;
  font-size: 1em;
}
.indent {
  display: block;
  font-size: 1em;
  margin-top: 0em;
  margin-right: 0;
  margin-bottom: .1em;
  margin-left: 0;
  text-align: left;
  text-indent: 2em;
}
.noindent {
  display: block;
  font-size: 1em;
  margin-top: 2em;
  margin-right: 0;
  margin-bottom: .1em;
  margin-left: 0;
  text-align: left;
  text-indent: 0;
}
.chapter {
  display: block;
  font-size: 1.2em;
  font-weight: bold;
  margin-top: 1em;
  margin-right: 0;
  margin-bottom: 1em;
  margin-left: 0;
  text-align: center;
  text-indent: 0;
}
.quotations {
  display: block;
  font-style: italic;
  font-size: 1em;
  margin-top: 0;
  margin-right: 0;
  margin-bottom: 0.5em;
  margin-left: 2em;
  text-indent: 0;
}
.center {
  text-align: center;
  text-indent: 0;
  margin: .5em 0 .5em 0;
}
.right {
  text-align: right;
  text-indent: 0;
  margin: .5em 0 .5em 0;
}
.verse {
  display: block;
  font-size: 1em;
  font-style: italic;
  margin-top: 0;
  margin-right: 0;
  margin-bottom: 0.1em;
  margin-left: 3em;
  text-align: left;
  text-indent: -2em;
}
.verse1 {
  display: block;
  font-size: 1em;
  font-style: italic;
  margin-top: 1em;
  margin-right: 0;
  margin-bottom: 0.1em;
  margin-left: 3em;
  text-align: left;
  text-indent: -2em;
}
.widepic {
  height: auto; 
  width: 98%;
}
.narrowpic {
  height: auto;
  width: 50%;
}
retiredbiker is offline   Reply With Quote
Old 04-16-2022, 05:14 PM   #12
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: 74,488
Karma: 129668758
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 retiredbiker View Post
I use this to make books read well in my Kobo Forma, without any fancy added fonts or anything. Just plain vanilla. This meets my needs, and as others have said somebody else will find it all ugly and wrong. Maybe once in 10 books I will go outside this for special formatting.

Code:
body {
  margin-top: 0.1em;
  margin-right: 0;
  margin-bottom: .1em;
  margin-left: 0;
  font-size: 1em;
}
.indent {
  display: block;
  font-size: 1em;
  margin-top: 0em;
  margin-right: 0;
  margin-bottom: .1em;
  margin-left: 0;
  text-align: left;
  text-indent: 2em;
}
.noindent {
  display: block;
  font-size: 1em;
  margin-top: 2em;
  margin-right: 0;
  margin-bottom: .1em;
  margin-left: 0;
  text-align: left;
  text-indent: 0;
}
.chapter {
  display: block;
  font-size: 1.2em;
  font-weight: bold;
  margin-top: 1em;
  margin-right: 0;
  margin-bottom: 1em;
  margin-left: 0;
  text-align: center;
  text-indent: 0;
}
.quotations {
  display: block;
  font-style: italic;
  font-size: 1em;
  margin-top: 0;
  margin-right: 0;
  margin-bottom: 0.5em;
  margin-left: 2em;
  text-indent: 0;
}
.center {
  text-align: center;
  text-indent: 0;
  margin: .5em 0 .5em 0;
}
.right {
  text-align: right;
  text-indent: 0;
  margin: .5em 0 .5em 0;
}
.verse {
  display: block;
  font-size: 1em;
  font-style: italic;
  margin-top: 0;
  margin-right: 0;
  margin-bottom: 0.1em;
  margin-left: 3em;
  text-align: left;
  text-indent: -2em;
}
.verse1 {
  display: block;
  font-size: 1em;
  font-style: italic;
  margin-top: 1em;
  margin-right: 0;
  margin-bottom: 0.1em;
  margin-left: 3em;
  text-align: left;
  text-indent: -2em;
}
.widepic {
  height: auto; 
  width: 98%;
}
.narrowpic {
  height: auto;
  width: 50%;
}
Do you realize you lose hyphenation on Kobo if you have the text left justified?

Anyway, I've simplified your CSS slightly and added widows and orphans of 1. I also changed .indent to p so you can use just <p> for most paragraphs and not have to use a class. Otherwise the functionality is the same. I've deleted the lines you don't need and moved the text-align: left to body so you only need it once.

Code:
body {
  tyext-align: left;
  margin-top: 0.1em;
  margin-right: 0;
  margin-bottom: .1em;
  margin-left: 0;
  widows: 1;
  orphans: 1;
}
p {
  margin-top: 0em;
  margin-bottom: .1em;
  text-indent: 2em;
}
.noindent {
  margin-top: 2em;
  margin-bottom: .1em;
  text-indent: 0;
}
.chapter {
  font-size: 1.2em;
  font-weight: bold;
  margin-top: 1em;
  margin-bottom: 1em;
  text-align: center;
  text-indent: 0;
}
.quotations {
  font-style: italic;
  margin-top: 0;
  margin-bottom: 0.5em;
  margin-left: 2em;
  text-indent: 0;
}
.center {
  text-align: center;
  text-indent: 0;
  margin-top: 0.5em;
  margin-bottom: 0.5em;
}
.right {
  text-align: right;
  text-indent: 0;
  margin-top: 0.5em;
  margin-bottom: 0.5em;
}
.verse {
  font-style: italic;
  margin-top: 0;
  margin-bottom: 0.1em;
  margin-left: 3em;
  text-indent: -2em;
}
.verse1 {
  display: block;
  font-size: 1em;
  font-style: italic;
  margin-top: 1em;
  margin-bottom: 0.1em;
  margin-left: 3em;
  text-indent: -2em;
}
.widepic {
  height: auto; 
  width: 98%;
}
.narrowpic {
  height: auto;
  width: 50%;
}

Last edited by JSWolf; 04-17-2022 at 05:52 AM.
JSWolf is offline   Reply With Quote
Old 04-16-2022, 06:04 PM   #13
DNSB
Bibliophagist
DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.
 
DNSB's Avatar
 
Posts: 36,320
Karma: 145735552
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
Quote:
Originally Posted by JSWolf View Post
Do you realize you lose hyphenation on Kobo if you have the text left justified?
Jon, do you realize that some of us actually prefer to read using left justification? Strange but true.
DNSB is offline   Reply With Quote
Old 04-16-2022, 06:13 PM   #14
enuddleyarbl
Guru
enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.
 
enuddleyarbl's Avatar
 
Posts: 734
Karma: 1077122
Join Date: Sep 2013
Device: Kobo Forma
To boldify (embolden?), italicize or underline words (not necessarily paragraphs), would I use these:

Code:
.bold {
  font-weight: bold;
}
.italic {
  font-style: italic;
}
.underline {
  text-decoration: underline;
}
?
enuddleyarbl is offline   Reply With Quote
Old 04-16-2022, 06:29 PM   #15
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: 74,488
Karma: 129668758
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 DNSB View Post
Jon, do you realize that some of us actually prefer to read using left justification? Strange but true.
Yes I do. That is just to let it be known that hyphenation won't work on a Kobo left justified. I did leave in the left justification in the CSS.
JSWolf is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Linking to CSS stylesheet mossman26 Sigil 2 07-16-2020 02:38 PM
pagestyle.css extra / integrated in stylesheet.css / or not at all? chaot Workshop 14 02-24-2017 11:10 PM
stylesheet.CSS anyone? ProDigit ePub 81 12-26-2015 01:43 PM
Converting cm to em in css stylesheet roger64 ePub 41 06-13-2014 01:00 PM
Where is the stylesheet.css? roger64 Sigil 4 03-23-2010 02:12 PM


All times are GMT -4. The time now is 08:22 PM.


MobileRead.com is a privately owned, operated and funded community.