cosmic/files/epub.css

276 lines
3.7 KiB
CSS

/* from http://bbebooksthailand.com/bb-CSS-boilerplate.html */
/* This adds margins around every page to stop ADE's line numbers from being superimposed over content */
@page {
margin: 10px;
}
/*===Reset code to prevent cross-reader strangeness===*/
html,
body,
div,
span,
applet,
object,
iframe,
h1,
h2,
h3,
h4,
h5,
h6,
p,
blockquote,
pre,
a,
abbr,
acronym,
address,
big,
cite,
code,
del,
dfn,
em,
img,
ins,
kbd,
q,
s,
samp,
small,
strike,
strong,
sub,
sup,
tt,
var,
b,
u,
i,
center,
fieldset,
form,
label,
legend,
table,
caption,
tbody,
tfoot,
thead,
tr,
th,
td,
article,
aside,
canvas,
details,
embed,
figure,
figcaption,
footer,
header,
hgroup,
menu,
nav,
output,
ruby,
section,
summary,
time,
mark,
audio,
video {
margin: 0;
padding: 0;
border: 0;
font-size: 100%;
vertical-align: baseline;
}
table {
border-collapse: collapse;
border-spacing: 0;
}
ol,
ul,
li,
dl,
dt,
dd {
margin: 0;
padding: 0;
border: 0;
font-size: 100%;
vertical-align: baseline;
}
/*===GENERAL PRESENTATION===*/
/*===Body Presentation and Margins===*/
/* Text alignment is still a matter of debate. Feel free to change to text-align: left; */
body {
text-align: justify;
line-height: 1.2em;
}
/*===Headings===*/
/* After page breaks, eReaders sometimes do not render margins above the content. Adjusting padding-top can help */
h1 {
text-indent: 0;
text-align: left;
margin: 0 0 30px 0;
font-size: 18px;
font-weight: normal;
page-break-before: avoid;
line-height: 1.2em; /*gets squished otherwise on ADE */
border-bottom: 1px solid black;
}
h2 {
text-indent: 0;
text-align: center;
margin: 20px 0 0 0;
font-size: 14px;
font-weight: bold;
page-break-before: avoid;
line-height: 1.2em; /*get squished otherwise on ADE */
}
tr, img {
page-break-inside: avoid;
}
img {
max-width: 100% !important;
}
@page :left {
margin: 15mm 20mm 15mm 10mm;
}
@page :right {
margin: 15mm 10mm 15mm 20mm;
}
/* Hyphen and pagination Fixer */
/* Note: Do not try on the Kindle, it does not recognize the hyphens property */
h1,
h2,
h3,
h4,
h5,
h6 {
-webkit-hyphens: none !important;
hyphens: none;
page-break-after: avoid;
page-break-inside: avoid;
page-break-before: avoid;
}
/*===Paragraph Elements===*/
/* Margins are usually added on the top, left, and right, but not on the bottom to prevent certain eReaders not collapsing white space properly */
p {
margin: 0;
widows: 2;
orphans: 2;
}
/* 1st level TOC */
p.toctext {
margin: 0 0 0 1.5em;
text-indent: 0;
}
/* 2nd level TOC */
p.toctext2 {
margin: 0 0 0 2.5em;
text-indent: 0;
}
h1.main {
text-align: center;
border-bottom: 0;
margin-top: 300px;
margin-bottom: 5px;
font-size: 32px;
font-variant: small-caps;
}
h1.toc-title {
margin-left: 2em;
}
h1.subtitle {
font-style: italic;
font-size: larger;
font-weight: bold;
margin-left: 0;
margin-bottom: 1em;
text-align: center;
border-bottom: 0;
}
.rights {
display: block;
position: absolute;
bottom: 30px;
left: 15px;
}
/*==LISTS==*/
ul {
margin: 1em 0 0 3em;
text-align: left;
}
ol {
margin: 1em 0 0 3em;
text-align: left;
font-size: 14px;
line-height: 1.3em;
}
ol li a {
text-decoration: none;
}
/* This fixes the bug where the text-align property of block-level elements is not recognized on iBooks
example: html markup would look like <p class="centered"><span class="ipadcenterfix">Centered Content</span></p> */
span.ipadcenterfix {
text-align: center;
}
/*==eBook Specific Formatting Below Here==*/
body {
padding: 1em;
font-family: monospace;
}
pre {
font-size: 10px;
line-height: 1.1em;
text-align: left;
white-space: pre;
}
blockquote {
color: #666666;
margin: 1em 0;
padding-left: 1.5em;
border-left: 0.5em #eee solid;
}
p {
margin: 1em 0;
}
.level1 {
}