View Single Post
Old 10-04-2014, 10:06 PM   #6
blackest
Connoisseur
blackest began at the beginning.
 
Posts: 67
Karma: 10
Join Date: Sep 2014
Device: sony prs 2
Quote:
Originally Posted by Phylis Sophical View Post
Thanks for all your reply's. I'll work my way through them. btw, I only use Calibre to view the finished book, no editing. Also, I've realized any of the H1, H2 etc. can be used for the TOC. and this gives me more simple options to change the look.
not sure if this will work here. but here goes

<head>
<link href="../Styles/styles.css" rel="stylesheet" type="text/css" />

<title></title>
</head>

every html file has a head and a body
stuff in the body between tags is displayed, the header does different things this head is very simple it has a title section which is empty (the book title should go there) and says to use a style sheet.
the Styles link is more interesting this header says to use a style sheet in Styles folder called styles.css you can create it by right clicking the styles folder in the left panel of sigil and naming it as you want. if you called it fred.css then the link in the header would read ,./Styles/fred.css

You can write styles within the html code but its not a good idea because if you want to change how things look you are forced to go through everything looking for where you styled something and changing the values, horrible tedious and error prone.

here is a little bit of style sheet


blockquote { margin: 0em 0em 0em 1.25em }
p { margin: 0em }
.bold { font-weight: bold }
.italic { font-style: italic }

if you look at p for example it sets the margin for a paragraph to 0em if i changed that to 1 em then every paragraph would have a margin of 1em
you can set up lots of attributes in a stylesheet for an element

you can call a class anything you like, how about joe
.joe{
font-weight: bold;
font-style: italic;
}

the layout is a little different but its an attribute followed by a colon followed by a value followed by a semicolon all the attributes are enclosed by { and }

now i can have a paragragh of class="joe" and it will be both bold and italic

I don't know if this editor will eat the html and style stuff that I wrote here but a geat example of styling different elements is the three men in a boat epub on this site.

epub is xml and its pretty much html just like a web page and libreoffice can save a doc as html too so you can import it into an epub very easily. if you google "introduction to html and css" you should find lots of examples of how you can style html documents
and an epub is just like a zipped up set of webpages.

I hope this wasn't too confusing and nothing got ate
blackest is offline   Reply With Quote