MobileRead Forums
Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Software > Calibre

Welcome to the MobileRead Forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community today, you will have fewer ads, access to post topics, communicate privately with other members, respond to polls, upload content and access many other special features.

If you have any problems with the registration process or your account login, please contact us.

Hint: Don't have time to visit us daily? Subscribe to our main RSS feed to receive our frontpage posts at your convenience.

Notices

Calibre Calibre is an open-source library manager to view, convert and catalog e-books. Cross-platform (Linux, Windows and OS X)

Reply
 
Thread Tools Search this Thread Display Modes
Old 07-20-2009, 01:24 PM   #1
Ralob
Enthusiast
Ralob began at the beginning.
 
Posts: 37
Karma: 10
Join Date: Feb 2008
Device: Bookeen Cybook Gen3, Nokia N810
Custom CSS Stylesheets for Calibre's Viewer

This thread is for people to post their CSS custom stylesheets for the Calibre eBook Viewer. I know that not everyone is familiar with CSS, so I hope that if anyone needs assistance in making their eBooks display properly, they will find something useful in here.
Ralob is offline   Reply With Quote
 
Enthusiast
Old 07-21-2009, 01:03 AM   #2
Ralob
Enthusiast
Ralob began at the beginning.
 
Posts: 37
Karma: 10
Join Date: Feb 2008
Device: Bookeen Cybook Gen3, Nokia N810
My personal CSS style is extremely basic, but it does exactly what I want- proper indentation for all paragraphs, adequate spacing between lines, background color that is easy on the eyes, and centered headings. Very basic but it does its job.

body {color:rgb(0,0,0);
background-color:rgb(174,174,174);
text-align:justify;
line-spacing:1.8;
margin-top:0px;
margin-bottom:4px;
margin-right:50px;
margin-left:50px;
text-indent:3em;}
h1, h2, h3, h4, h5, h6
{color:black;
text-align:center;
font-style:italic;
font-weight:bold;}

Last edited by Ralob; 08-05-2009 at 07:50 PM.
Ralob is offline   Reply With Quote
Old 07-31-2009, 06:29 PM   #3
ekaser
Opinion Artiste
ekaser will become famous soon enoughekaser will become famous soon enoughekaser will become famous soon enoughekaser will become famous soon enoughekaser will become famous soon enoughekaser will become famous soon enough
 
ekaser's Avatar
 
Posts: 263
Karma: 654
Join Date: Mar 2009
Location: Albany, OR
Device: Dell Pocket PC, EZ Reader Pocket Pro, 1952 BiOcs
Thanks for sharing, Ralob! I like pretty much your whole setup, except I like a lighter, slightly off-gray background, and slightly less indent:

background-color:rgb(228,226,224);
text-indent:2em;
ekaser is offline   Reply With Quote
Old 07-31-2009, 10:55 PM   #4
lcbannon
Enthusiast
lcbannon began at the beginning.
 
Posts: 31
Karma: 10
Join Date: Jul 2009
Device: Sony PRS 505
Do I put this in the extra css box for code in the Look and Feel area???
lcbannon is offline   Reply With Quote
Old 07-31-2009, 11:05 PM   #5
ekaser
Opinion Artiste
ekaser will become famous soon enoughekaser will become famous soon enoughekaser will become famous soon enoughekaser will become famous soon enoughekaser will become famous soon enoughekaser will become famous soon enough
 
ekaser's Avatar
 
Posts: 263
Karma: 654
Join Date: Mar 2009
Location: Albany, OR
Device: Dell Pocket PC, EZ Reader Pocket Pro, 1952 BiOcs
Quote:
Originally Posted by lcbannon View Post
Do I put this in the extra css box for code in the Look and Feel area???
In the Ebook Viewer application, click on the Hammer icon (Preferences), then put the code in the "User stylesheet" edit box and click OK. Have an ebook open in the viewer for the full effect, before and after.
ekaser is offline   Reply With Quote
Old 08-04-2009, 07:51 AM   #6
sideburnt
Connoisseur
sideburnt began at the beginning.
 
Posts: 77
Karma: 46
Join Date: May 2009
Device: Sony prs-505
If you're interested in CSS Styling take a quick look at
http://epubzengarden.com/?style=trad.../chapter1.html

Its a very new site but could become fantastic with a bit of contribution.

Hard to navigate around and took me a while to find the css preview page, I have linked to my favorite page style used on this site.
sideburnt is offline   Reply With Quote
Old 08-05-2009, 11:00 AM   #7
ekaser
Opinion Artiste
ekaser will become famous soon enoughekaser will become famous soon enoughekaser will become famous soon enoughekaser will become famous soon enoughekaser will become famous soon enoughekaser will become famous soon enough
 
ekaser's Avatar
 
Posts: 263
Karma: 654
Join Date: Mar 2009
Location: Albany, OR
Device: Dell Pocket PC, EZ Reader Pocket Pro, 1952 BiOcs
Quote:
Originally Posted by Ralob View Post
My personal CSS style is extremely basic...

body {color rgb(0,0,0);
background-color:rgb(174,174,174);
You have an error in there. I was testing out a completely different color scheme (harking back to the "good old" MS-DOS days), when I used WHITE on BLUE background for my console (worked better then, with fixed pitch, large fonts :-). In your code above, you need to add a ':' after the body 'color' name. Without it, the body (text) color is ignored. It still works for what you want, because the default color is black. But it doesn't work if you try to set it to anything else. Not necessarily pleasing to use, but as another example, here's my "white on blue" style:

body {
color: rgb(255,255,255);
background-color:rgb(0,0,255);
text-align:justify;
line-spacing:1.8;
margin-top:0px;
margin-bottom:4px;
margin-right:50px;
margin-left:50px;
text-indent:2em;
}
h1, h2, h3, h4, h5, h6 {
color:white;
text-align:center;
font-style:italic;
font-weight:bold;
}
ekaser is offline   Reply With Quote
Old 08-05-2009, 07:46 PM   #8
Ralob
Enthusiast
Ralob began at the beginning.
 
Posts: 37
Karma: 10
Join Date: Feb 2008
Device: Bookeen Cybook Gen3, Nokia N810
Oops! Thanks

Fixed.

Last edited by Ralob; 08-05-2009 at 07:51 PM.
Ralob is offline   Reply With Quote
Old 08-06-2009, 04:00 AM   #9
mtravellerh
book creator
mtravellerh can even cheer up an android equipped with a defective Genuine Personality Prototype.mtravellerh can even cheer up an android equipped with a defective Genuine Personality Prototype.mtravellerh can even cheer up an android equipped with a defective Genuine Personality Prototype.mtravellerh can even cheer up an android equipped with a defective Genuine Personality Prototype.mtravellerh can even cheer up an android equipped with a defective Genuine Personality Prototype.mtravellerh can even cheer up an android equipped with a defective Genuine Personality Prototype.mtravellerh can even cheer up an android equipped with a defective Genuine Personality Prototype.mtravellerh can even cheer up an android equipped with a defective Genuine Personality Prototype.mtravellerh can even cheer up an android equipped with a defective Genuine Personality Prototype.mtravellerh can even cheer up an android equipped with a defective Genuine Personality Prototype.mtravellerh can even cheer up an android equipped with a defective Genuine Personality Prototype.
 
mtravellerh's Avatar
 
Posts: 8,266
Karma: 30677
Join Date: Oct 2008
Location: Luxembourg
Device: PocketBook 360°, Cool-er, Ipod Touch
Quote:
Originally Posted by Ralob View Post
Oops! Thanks

Fixed.
A propos margins: Please be advised that, if you use your CSS in ePubs for the ADEPT engine, the default page numbers will flow in the text body.
__________________
PR and Sales Pocketbook

Deutsches MobileRead Forum rocks!
MM-Klub: PB360° owners unite!
mtravellerh is offline   Reply With Quote
Old 08-06-2009, 01:18 PM   #10
Ralob
Enthusiast
Ralob began at the beginning.
 
Posts: 37
Karma: 10
Join Date: Feb 2008
Device: Bookeen Cybook Gen3, Nokia N810
Quote:
Originally Posted by mtravellerh View Post
A propos margins: Please be advised that, if you use your CSS in ePubs for the ADEPT engine, the default page numbers will flow in the text body.
Thanks for the info. I haven't used ePub yet as my reader doesn't support it ATM. But, I will keep this in mind for when I start using them.
Ralob is offline   Reply With Quote
Old 12-29-2009, 09:09 PM   #11
PhillipA82
Addict
PhillipA82 will become famous soon enoughPhillipA82 will become famous soon enoughPhillipA82 will become famous soon enoughPhillipA82 will become famous soon enoughPhillipA82 will become famous soon enoughPhillipA82 will become famous soon enough
 
Posts: 296
Karma: 622
Join Date: Dec 2009
Device: kindle
Quote:
Originally Posted by mtravellerh View Post
A propos margins: Please be advised that, if you use your CSS in ePubs for the ADEPT engine, the default page numbers will flow in the text body.
Didn't know that, thanks
PhillipA82 is offline   Reply With Quote
Old 01-13-2010, 04:30 AM   #12
rakulos
Member
rakulos began at the beginning.
 
Posts: 17
Karma: 14
Join Date: Aug 2009
Device: ipad
Hi,
Anyone having issues in getting the CSS to apply in the epub viewer? I'm using 0.6.31 and reading a variety of epubs from feedbooks, I've applied the CSS examples in this thread and clicked ok but the display never changes.

Sorry if I'm missing something blatantly obvious
rakulos is offline   Reply With Quote
Old 01-13-2010, 04:59 AM   #13
Jellby
frumious Bandersnatch
Jellby has much to be proud ofJellby has much to be proud ofJellby has much to be proud ofJellby has much to be proud ofJellby has much to be proud ofJellby has much to be proud ofJellby has much to be proud ofJellby has much to be proud ofJellby has much to be proud ofJellby has much to be proud ofJellby has much to be proud of
 
Jellby's Avatar
 
Posts: 2,659
Karma: 27292
Join Date: Jan 2008
Location: Sunny Spain
Device: Cybook Gen3
Maybe the book you are reading already defines CSS styles that override your definitions? Try adding "!important", for example:

Code:
body { color: red !important; }
Jellby is offline   Reply With Quote
Old 01-13-2010, 02:48 PM   #14
JirkaS
Member
JirkaS began at the beginning.
 
Posts: 13
Karma: 10
Join Date: Nov 2009
Device: iPhone
Another good site for learning CSS and testing your trials is http://www.w3schools.com/Css/default.asp
JirkaS is offline   Reply With Quote
Old 01-13-2010, 06:47 PM   #15
heidismiles
Junior Member
heidismiles began at the beginning.
 
Posts: 2
Karma: 10
Join Date: Jan 2010
Device: iPhone
Hi all, this may be a stupid question but I'm having trouble getting different fonts to show up in one book? Is this even possible?

I have several Stephen King files that I'm trying to convert from HTML. King often writes about writers, and when he does, there are usually several sections of a book in "typewriter" text.

I tried doing it this way:
<p style="font: 9.0px 'Courier New'">CHAPTER 1</p>

The font shows up in Calibre, but not on Stanza on my iPhone.
Any suggestions?
heidismiles is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
ebook-viewer: Open source, crossplatform viewer for EPUB, LIT, MOBI, etc kovidgoyal Calibre 61 08-16-2009 02:51 PM
What is Calibre's 'internal' format? rogue_ronin Calibre 6 06-07-2009 11:07 AM
congrats!! calibre's been lifehacked!! :) CheriePie Calibre 3 03-16-2009 05:29 AM
Controlling Calibre's Splits for epubs. brewt Calibre 4 12-31-2008 03:10 PM
Calibre's generated css for epub brewt Calibre 7 12-29-2008 09:59 AM


All times are GMT -4. The time now is 06:23 PM.


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