11-14-2012, 10:40 AM | #151 |
Junior Member
Posts: 1
Karma: 10
Join Date: Nov 2012
Device: iPhone
|
Here's an "iBook" theme I created for my 13" Macbook Pro (1280 x 800) display:
http://pastebin.com/tUxfe8cL# Should be able to just cut 'n' paste this -- it has a base64 encoded png of a "book" as the image-background. Works well in full screen mode on my 1280x800 display -- probably won't work on other display sizes. Thanks to the base64 encoding there's a lot of css text, so it may take a minute to load into your "user stylesheet" tab (be prepared for spinning rainbow wheel). Mac users: if you want to craft your own, use following css along with the background image of your choice (put the image in /Users/<your username>/Library/Preferences/calibre/images): body {color:rgb(80,58,34); background-color:rgb(174,174,174); background-image:url("/Users/<your username>/Library/Preferences/calibre/images/<filename>.png"); background-repeat:no-repeat; background-attachment:fixed; background-position:center; text-align:justify; line-spacing:1.8; margin-top:50px; margin-bottom:50px; margin-right:50px; margin-left:50px; text-indent:3em;} h1, h2, h3, h4, h5, h6 {color:rgb(80,58,34); text-align:center; font-style:italic; font-weight:bold;} |
12-06-2012, 08:07 AM | #152 | |
Junior Member
Posts: 2
Karma: 10
Join Date: Dec 2012
Device: Pc
|
Quote:
Or point me how i can do this via Calibre interface, in case i am blind and I've missed it. |
|
Advert | |
|
12-29-2012, 08:10 PM | #153 |
Junior Member
Posts: 3
Karma: 10
Join Date: Dec 2012
Device: Sony
|
Please, how to make margin-bottom and margin-top working ??
|
12-29-2012, 09:07 PM | #154 |
US Navy, Retired
Posts: 9,867
Karma: 13806776
Join Date: Feb 2009
Location: North Carolina
Device: Icarus Illumina XL HD, Kindle PaperWhite SE 11th Gen
|
|
12-30-2012, 07:09 AM | #155 |
Guru
Posts: 644
Karma: 1242364
Join Date: May 2009
Location: The Right Coast
Device: PC (Calibre), Nexus 7 2013 (Moon+ Pro), HTC HD2/Leo (Freda)
|
Ms_ts_2007,
I believe just the following should do what you want: body { background:#F9F0C9 url('file:///C:/Program Files (x86)/Calibre2/resources/images/old_paper.jpg'); } If the book you load includes it's own background color (the #F.. portion) and image (the url portion) it might override the info above. Adding " !important" (including space but without quotes) after the closing parenthesis and before the semi-colon might correct this issue. (I've never used an image. It will definitely override the color.) CSS, kind of like missing ebook metadata, doesn't complain if various bits and pieces are not present. CSS just assumes that the defaults apply and only the mentioned bits are being changed. The body section affects the page itself; the p is for defining paragraphs, the h1-p6 are various heading definitions. The selection... is beyond my knowledge. Last edited by Sabardeyn; 12-30-2012 at 07:15 AM. |
Advert | |
|
12-30-2012, 12:05 PM | #156 | |
Well trained by Cats
Posts: 30,455
Karma: 58055868
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
Quote:
That path is to the Calibre install folder (which varies by OS) (as do the direction of the \'s ) It would be better to place a COPY of that file into the resources\images of the configuration folder BTW 'old_paper.jpg' does not exist in my (default, calibre) install Last edited by theducks; 12-30-2012 at 12:06 PM. Reason: configuration folder |
|
12-30-2012, 08:03 PM | #157 |
Guru
Posts: 644
Karma: 1242364
Join Date: May 2009
Location: The Right Coast
Device: PC (Calibre), Nexus 7 2013 (Moon+ Pro), HTC HD2/Leo (Freda)
|
Thanks for the clarification, I'm sure it will be of help to users of other OSes.
The info posted was from Cyberxaos' post originally. I just excised the applicable example and did the "CSS to English" translation. The original post has a link that includes the image, I think. Never used pastebin so I'm not sure how they've implemented things - it appears to be a hex dump of an image file. |
01-05-2013, 11:57 AM | #158 | |
Junior Member
Posts: 3
Karma: 10
Join Date: Dec 2012
Device: Sony
|
Quote:
even so thanks for your answer. EDIT: I would be better to apply 'user stylesheet' to a div cantaining all the page instead of body. The scenario for displaying text would be the same, but we can apply a margin before displaying this div in the body. But perhaps, it's not possible... Last edited by maisondouf; 01-05-2013 at 12:20 PM. |
|
01-05-2013, 12:58 PM | #159 |
Junior Member
Posts: 3
Karma: 10
Join Date: Dec 2012
Device: Sony
|
Youpi, I found a better solution...
Uninstall Ubuntu version (0.8.38) ande install last stable (0.9.13). Now margin options are available. |
01-06-2013, 03:04 AM | #160 | ||
US Navy, Retired
Posts: 9,867
Karma: 13806776
Join Date: Feb 2009
Location: North Carolina
Device: Icarus Illumina XL HD, Kindle PaperWhite SE 11th Gen
|
Quote:
From What's New: Quote:
|
||
01-11-2013, 04:56 PM | #161 |
Junior Member
Posts: 8
Karma: 10
Join Date: Jan 2013
Device: Kindle Keyboard
|
Background color ignored?
Hi,
I created a user CSS template from some of the examples here but it seems that the background color is ignored by the Calibre eBook viewer. I can change the color in the eBook viewer preferences window but not through the CSS style-sheet. Is this a bug or is there something wrong with my code? Calibre version 0.9.14 on Windows 8 64-bit. Code:
h1, h2, h3, h4, h5, h6 { font-weight: bolder; text-transform: capitalize; color: rgb(0, 0, 0); text-align:center; } body { color: rgb(0, 0, 0); background-color: rgb(254, 243, 213); text-align: justify; line-spacing: 1.8; margin-top: 0px; margin-bottom: 4px; margin-right: 50px; margin-left: 50px; text-indent: 3em; } |
01-11-2013, 11:52 PM | #162 |
creator of calibre
Posts: 44,573
Karma: 24495948
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
You need to use !important to ensure you override whatever color is set in the books code.
|
01-17-2013, 05:10 PM | #163 |
Junior Member
Posts: 1
Karma: 10
Join Date: Jan 2013
Device: samsung GT-P5100
|
Dear all,
I am a new user and don't know much about CSS. I am using Persian language. It is from right to left. How can I tell Calibre through CSS to change the text-direction to "right-to-left"? Thanks in advance. |
01-23-2013, 05:38 PM | #164 |
Groupie
Posts: 171
Karma: 10
Join Date: Dec 2008
Device: Likebook Mars
|
I'm trying to use this background image how do I stop it from being tiled so it fits the Calibre reader? I'm attempting to create something similar to what I have set up in ubook.
Thanks. Last edited by Vortex; 01-23-2013 at 05:46 PM. |
01-23-2013, 07:50 PM | #165 | |
Well trained by Cats
Posts: 30,455
Karma: 58055868
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
Quote:
Code:
background-repeat: no-repeat; |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Custom CSS for output | deckoff | Calibre | 1 | 08-29-2010 12:55 AM |
ePub with custom .css on a 505 | dicknskip | Sony Reader Dev Corner | 3 | 06-10-2010 12:34 AM |
User stylesheets for ePub files | salty-horse | Sony Reader Dev Corner | 12 | 02-23-2010 08:44 AM |
ePub conversion: override existing css with a custom one | sbin | Calibre | 1 | 01-09-2010 05:03 AM |
Calibre's generated css for epub | brewt | Calibre | 7 | 12-29-2008 10:59 AM |