View Single Post
Old 04-05-2011, 06:12 PM   #1
Hatgirl
Addict
Hatgirl ought to be getting tired of karma fortunes by now.Hatgirl ought to be getting tired of karma fortunes by now.Hatgirl ought to be getting tired of karma fortunes by now.Hatgirl ought to be getting tired of karma fortunes by now.Hatgirl ought to be getting tired of karma fortunes by now.Hatgirl ought to be getting tired of karma fortunes by now.Hatgirl ought to be getting tired of karma fortunes by now.Hatgirl ought to be getting tired of karma fortunes by now.Hatgirl ought to be getting tired of karma fortunes by now.Hatgirl ought to be getting tired of karma fortunes by now.Hatgirl ought to be getting tired of karma fortunes by now.
 
Hatgirl's Avatar
 
Posts: 296
Karma: 955301
Join Date: Oct 2008
Device: Sony PRS-300, Sony PRS-T2, Kindle (7th Gen)
Applying multiple classes to an element

I am attempting to create a mobi format ebook by using kindlegen to convert an epub. I've managed to figure out the solution to most of the problems I've encountered, like preventing the cover appearing twice and adding guide items, but one problem has me stumped: it seems I can't apply multiple classes to an element.

So let's say this is an excerpt from my css file
Code:
p.italic {
    font-style: italic; 
}

p.bold {
    font-weight: bold;
}

And this is excerpt from the code in my xhtml file
Code:
<p>Oh, do you know the muffin man,</p>
<p class="italic">The muffin man, the muffin man,</p>
<p class="bold">Do you know the muffin man,</p>
<p class="italic bold">Who lives in Drury Lane?</p>

My epub looks like this:
Quote:
Oh, do you know the muffin man,
The muffin man, the muffin man,
Do you know the muffin man,
Who lives in Drury Lane?

But when I convert that epub to a mobi, it looks like this!
Quote:
Oh, do you know the muffin man,
The muffin man, the muffin man,
Do you know the muffin man,
Who lives in Drury Lane?

Aaaaarrrgghh! Can I seriously not apply multiple classes to an element?! Damn you, Amazon, I don't want to be spending my time dealing with this idiocy. Epub Rules, Mobi Drools!

There are obvious work arounds for this (just create a unique class like p.ihatemobi {font-style: italic; font-weight: bold;} ) but I'm hoping I'm wrong and you'll point out some comma or semi-colon I've missed out that will allow multiple classes
Hatgirl is offline   Reply With Quote