Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Formats > Kindle Formats

Notices

Reply
 
Thread Tools Search this Thread
Old 01-23-2012, 11:09 PM   #1
virtual_ink
Zealot
virtual_ink can extract oil from cheesevirtual_ink can extract oil from cheesevirtual_ink can extract oil from cheesevirtual_ink can extract oil from cheesevirtual_ink can extract oil from cheesevirtual_ink can extract oil from cheesevirtual_ink can extract oil from cheesevirtual_ink can extract oil from cheese
 
virtual_ink's Avatar
 
Posts: 107
Karma: 1000
Join Date: Sep 2010
Location: Melbourne, Australia
Device: iPad2, Kindle
CSS for KindleGen2

I'm looking for some advice or a CSS template to use when converting ePubs (EPUB2) to Mobi via KindleGen2.

I'm finding most of my CSS converts well, but there a few rouge elements in some previews. For example, in the new Kindle Previewer, my chapter headings look fine for Kindle/KindeFire/KindleDX - but they are huge when previewed in Kindle for iPhone/iPad.

Is there a CSS setting which works well across all the Kindle preview options?

Here's some of my CSS for reference:

Normal text is:
p.body {
font-weight : normal;
font-style : normal;
font-size : 1em;
text-decoration : none;
font-variant : normal;
line-height : 1.2;
text-align : justify;
color : #000000;
text-indent : 16px;
margin : 0px;
widows:2;
orphans:2;
-webkit-hyphenate-before:3;
hyphenate-before:3;
-webkit-hyphenate-after:3;
hyphenate-after:3;
-webkit-hyphenate-lines:2;
hyphenate-lines:2;
}

Chapter headings are:
h1.chapter-title {
font-weight : bold;
font-style : normal;
font-size : 1.17em;
text-decoration : none;
font-variant : normal;
line-height : 1.2;
text-align : center;
color : #000000;
text-indent : 0px;
margin : 50px 0px 16px 0px;
-webkit-hyphens: none !important;
adobe-hyphenate: none !important;
-moz-hyphens: none !important;
hyphens: none !important;
}

Thanks!
virtual_ink is offline   Reply With Quote
Old 01-24-2012, 06:52 AM   #2
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 27,549
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
With the ability to define separate CSS for KF8 and the regular MOBI part, there's really no reason to try and find "One CSS to Rule Them All."
DiapDealer is offline   Reply With Quote
Advert
Old 01-27-2012, 01:15 AM   #3
virtual_ink
Zealot
virtual_ink can extract oil from cheesevirtual_ink can extract oil from cheesevirtual_ink can extract oil from cheesevirtual_ink can extract oil from cheesevirtual_ink can extract oil from cheesevirtual_ink can extract oil from cheesevirtual_ink can extract oil from cheesevirtual_ink can extract oil from cheese
 
virtual_ink's Avatar
 
Posts: 107
Karma: 1000
Join Date: Sep 2010
Location: Melbourne, Australia
Device: iPad2, Kindle
You may have a point! I'm still yet to figure out how Kindle handles CSS, if it essentially doesn't use CSS.

Do you know which CSS the KindlePreviewer for iPad/iPhone uses?
virtual_ink is offline   Reply With Quote
Old 01-28-2012, 12:54 PM   #4
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 27,549
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Quote:
You may have a point! I'm still yet to figure out how Kindle handles CSS, if it essentially doesn't use CSS.

Do you know which CSS the KindlePreviewer for iPad/iPhone uses?
The regular-old mobi format does not use CSS... correct... but KindlePreviewer (and Kindlegen) both convert user-provided source CSS to HTML 3.2 attributes when converting.

The new KF8 format does use CSS (very similarly to ePub), but the Kindle Fire is currently the only device that supports KF8 (the various reading apps will likely support KF8 sometime in the future).

So right now... KindlePreviewer and Kindlegen are building a hybrid MOBI that contain both the regular-old MOBI and the new KF8. Devices that support KF8 will use that (currently only Kindle Fire) and everything else will use the fall-back MOBI.

The new Kindle Publishing Guidlines (Section 8: Media Queries) provides about four different ways to differentiate between the CSS that's used to build the MOBI and CSS that's used to build the KF8.
DiapDealer is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Override ePub CSS with userStyle.css? barium Sony Reader Dev Corner 11 07-16-2011 03:25 PM
CSS Help Please Japes Calibre 21 06-23-2011 05:05 PM
epub CSS versus "Regular" CSS konrad ePub 4 02-18-2011 09:29 AM
css pseudo elements and adjacent combinators in extra css? ldolse Calibre 2 12-21-2010 05:09 PM
Help with CSS, anyone? rogue_ronin Workshop 36 08-14-2009 09:28 PM


All times are GMT -4. The time now is 08:25 PM.


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