![]() |
#1 |
Connoisseur
![]() Posts: 53
Karma: 10
Join Date: Jul 2012
Location: Seattle, USA
Device: Nook
|
CSS ignored in .mobi (on Kindle)
Hi,
I've spent the last few days putting together an eBook in .epub format which renders just fine on my Nook. In order to make it available for Kindle I used this website and it seems to do a decent enough job. (Turns out that the latest kindlegen (V2.4 build 69900, link) completely breaks the encoding of some of the Pali letters, and also bloats the final .mobi file to twice the size of the original .epub file, even with -c2 compression.) However ![]() Code:
<q class="bla">This is a quote.</q> Code:
q { quotes: none; } q.bla { font-style: italic; } Another issue are unordered bullet lists. Again, I style them to disable the bullets altogether Code:
ul.toc { list-style: none; } Code:
<ul class="toc"> <li> <a href="foreword.html">Foreword</a></li> ... </ul> How can I get rid of both, the quotation marks and the bullets; or is this a Kindle specific issue? Thanks! |
![]() |
![]() |
![]() |
#2 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,251
Karma: 3720310
Join Date: Jan 2009
Location: USA
Device: Kindle, iPad (not used much for reading)
|
.mobi does not directly support css. It can only translate some css into equivalent plain HTML, so these constructs will not work for .mobi.
|
![]() |
![]() |
Advert | |
|
![]() |
#3 |
frumious Bandersnatch
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 7,543
Karma: 19001583
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
|
And it is the converter which does the translation. Some converter may support some CSS, another converter will support a different set of CSS, and some things may be difficult/impossible to translate to mobi.
|
![]() |
![]() |
![]() |
#4 |
Groupie
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 184
Karma: 2572
Join Date: Aug 2010
Device: Kindle
|
What does that mean? The ultimate "converter" is Kindlegen, surely?
Last edited by Oldpilot; 07-02-2012 at 06:38 AM. |
![]() |
![]() |
![]() |
#5 |
Groupie
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 184
Karma: 2572
Join Date: Aug 2010
Device: Kindle
|
Wouldn't it be easier to go <i>This is a quote</i>?
I seem to recall that the Publishing Guidelines say (or used to say) that one can't use a table in the "table" of contents. http://kindlegen.s3.amazonaws.com/Am...Guidelines.pdf |
![]() |
![]() |
Advert | |
|
![]() |
#6 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 28,389
Karma: 203720150
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
You might want to also note that the <q> tag is only supported in the KF8 format (and only on the Kindle Fire) ... not the regular MOBI format.
The Amazon Kindle Publishing Guidlines gives you examples of several methods that can be used to specify separate CSS statements to tailor the MOBI portion in relation to the KF8 portion (and vice-versa). In short: starting with a validating ePub does not mean kindlegen will build from it, a MOBI/KF8 version that will be identical to the original ePub in every way. You have to learn what input Kindlegen will play nice with. The Amazon Kindle Publishing Guidelines is the place to start Also, the "bloat" you're referring to is because the Kindlegen output contains the MOBI version (for devices that don't support KF8), the KF8 version, and the source used to create the file (in this case, the content of your ePub). EDIT: and before you ask, no... any per/MB delivery fees that Amazon charges you is not based on the size of the file that Kindlegen produces. Only one version (MOBI/KF8) is ultimately delivered to the user based on their devices/app's capabilities. The size of the files sent to the user is the basis for that fee. Mobi_Unpack (post #5) is capable of splitting the KF8 portion of the combined file from the MOBI portion if you'd like to get an idea of the file sizes that an end-user would actually be seeing. Last edited by DiapDealer; 07-02-2012 at 08:40 AM. |
![]() |
![]() |
![]() |
#7 | |
frumious Bandersnatch
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 7,543
Karma: 19001583
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
|
Quote:
Note also that the "quotes" CSS property is not supported by ePub 2.01 (meaning that compliant reading systems are not required to support/recognize it), I don't know about KF8. |
|
![]() |
![]() |
![]() |
#8 |
Connoisseur
![]() Posts: 53
Karma: 10
Join Date: Jul 2012
Location: Seattle, USA
Device: Nook
|
Thank you for the responses! After I posted the question and spent the evening reading random (seemingly) related threads, I found that CSS is not part of the .mobi file. Gah.
What seems to work: replace the <q class...> tags with <span> and style the spans appropriately; that then translates in text without the quotes. Both, kindlegen and Calibre seem to add the quotation marks automatically (independently of the styling) and I couldn't find how to disable that. As for the statement above that kindlegen is the "ultimate" converter: well, it did a very poor job with my Pali characters, and I dropped it immediately. I tried Calibre and that hasn't messed up things. Yet :-) What about the bullet lists? Cheers! |
![]() |
![]() |
![]() |
#9 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 28,389
Karma: 203720150
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
Quote:
Basically, if you have a "list" of things (like a ToC) and you don't want them to have any bullets (or numbers for that matter), then you probably shouldn't be using html list elements (<ul>, <ol>) in the first place. They don't really gain you anything (heck, I don't even use them when I do want something numbered or bulleted). Just use paragraphs. Style those paragraphs with margin-left (or use blockquotes) if you need indentation. <ol>, <ul>, and <li> and all the css attributes that can be recognized/utilized (or will be recognized/utilized) varies so wildly and renders so differently on different devices/apps (ePub AND MOBI both) that I just don't waste my time with them. Last edited by DiapDealer; 07-02-2012 at 02:01 PM. |
|
![]() |
![]() |
![]() |
#10 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 5,689
Karma: 24031401
Join Date: Dec 2010
Device: Kindle PW2
|
Quote:
AFAIK, Pali can be written in a number of different alphabets. What kind of alphabet did you use and which characters did KindleGen have problems with? |
|
![]() |
![]() |
![]() |
#11 | |
Connoisseur
![]() Posts: 53
Karma: 10
Join Date: Jul 2012
Location: Seattle, USA
Device: Nook
|
Quote:
Code:
<?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> Code:
<html xmlns="http://www.w3.org/1999/xhtml"> ![]() Now: Can I strip the .mobi of all the overhead that is embedded in it? |
|
![]() |
![]() |
![]() |
#12 |
Groupie
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 184
Karma: 2572
Join Date: Aug 2010
Device: Kindle
|
|
![]() |
![]() |
![]() |
#13 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 28,389
Karma: 203720150
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
Quote:
|
|
![]() |
![]() |
![]() |
Tags |
css quotes lists |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Fixed Layout Sample ".mobi" file with package(html, css, opf, ncx files). | Sushil | Kindle Fire | 1 | 01-13-2012 07:16 AM |
CSS template for epub for the mobi conversioin | vogella | Kindle Formats | 5 | 11-02-2011 08:19 AM |
ePub to mobi, CSS and % | Barty | Conversion | 1 | 03-24-2011 09:50 PM |
CSS visiblility setting throws off TOC generation in MOBI | Guido Henkel | Calibre | 1 | 11-02-2010 05:16 AM |
CSS visiblility setting throws of TOC generation in MOBI | Guido Henkel | Calibre | 0 | 11-01-2010 06:13 PM |