View Single Post
Old 11-19-2010, 05:10 PM   #9
DMSmillie
Enquiring Mind
DMSmillie understands when you whisper 'The dog barks at midnight.'DMSmillie understands when you whisper 'The dog barks at midnight.'DMSmillie understands when you whisper 'The dog barks at midnight.'DMSmillie understands when you whisper 'The dog barks at midnight.'DMSmillie understands when you whisper 'The dog barks at midnight.'DMSmillie understands when you whisper 'The dog barks at midnight.'DMSmillie understands when you whisper 'The dog barks at midnight.'DMSmillie understands when you whisper 'The dog barks at midnight.'DMSmillie understands when you whisper 'The dog barks at midnight.'DMSmillie understands when you whisper 'The dog barks at midnight.'DMSmillie understands when you whisper 'The dog barks at midnight.'
 
DMSmillie's Avatar
 
Posts: 562
Karma: 42350
Join Date: Aug 2010
Location: London, UK
Device: Kindle 3 (WiFi)
(Hi Hitch! )

Heh... thank you kindly for those nice words, Hitch, but last few days I've been finding out more stuff I didn't know. There's always more, isn't there?

When I've been able to, I've been poking around with mobiunpack.py and a few other things, and Jellby is quite right - all of the CSS in the HTML used to create a mobi file gets turned into basic and/or proprietary HTML inside the mobi file by Kindlegen.

For example:

Code:
<p style="text-indent:0.3in">Paragraph with first line indent 0.3in.</p>
<p style="text-indent:5em">Paragraph with first line indent 5em.</p>
<p style="font-size:0.5em">Paragraph with font size 0.5em.</p>
<p style="font-size:16pt">Paragraph with font size 16pt.</p>
<p style="margin-left:0.5in;margin-top:12pt;margin-bottom:12pt">Paragraph with left margin 0.5in, and 12pt space before and after.</p>
<p style="margin-left:20%;margin-top:3em;margin-bottom:20px">Paragraph with left margin 20%, 3em space before and 20px space after.</p>
becomes:

Code:
<p width="29">Paragraph with first line indent 0.3in.</p> 
<p width="5em">Paragraph with first line indent 5em.</p> 
<p><font size="-3">Paragraph with font size 0.5em.</font></p> 
<p><font size="5">Paragraph with font size 16pt.</font></p> 
<p height="16"><blockquote>Paragraph with left margin 0.5in, and 12pt space before and after.</blockquote></p>
<div height="16"></div> 
<p height="3em"><blockquote>Paragraph with left margin 20%, 3em space before and 20px space after.</blockquote></p>
<div height="20"></div>
Seems like a major rewrite of the MOBI format will be needed for it to accommodate CSS properly. On the up side, it makes it a lot easier to figure out what CSS (in the input file) will work - if you can figure a way of doing essentially the same thing in HTML 3.2 (plus the proprietary use of "height" and "width" attributes in the <p> tag, and the proprietary <mbpagebreak/> tag), then it'll probably work. If there's no way of doing it with HTML 3.2, it probably won't. grrrrrrr!

- Donna
DMSmillie is offline   Reply With Quote