View Full Version : CSS classes on Android epub readers


MarleneW
04-29-2012, 10:32 PM
I'm trying to colour headings in my epub, but on every Android reader I have installed on my Galaxy 7.7, the class settings are ignored. I can colour using span tags, or back grounds in tables but nothing else at all. As I am new to CSS is there something I am doing wrong? It looks fine in Sigil....
I'm making the pages in Dreamweaver....

Jabby
04-30-2012, 07:11 AM
I'm trying to colour headings in my epub, but on every Android reader I have installed on my Galaxy 7.7, the class settings are ignored. I can colour using span tags, or back grounds in tables but nothing else at all. As I am new to CSS is there something I am doing wrong? It looks fine in Sigil....
I'm making the pages in Dreamweaver....

Try your question on the Sigil forum. They have knowledgeable CSS folks over there.

http://www.mobileread.com/forums/forumdisplay.php?f=203

Regards - John

theducks
04-30-2012, 10:13 AM
I'm trying to colour headings in my epub, but on every Android reader I have installed on my Galaxy 7.7, the class settings are ignored. I can colour using span tags, or back grounds in tables but nothing else at all. As I am new to CSS is there something I am doing wrong? It looks fine in Sigil....
I'm making the pages in Dreamweaver....

This appears to be a device limitation (ADE based devices has them also :rolleyes:) that you will need to find a work-around.
You said Colored Spans work?
Does a construct like
<h3 class="my1"><span class="my2">Text</span></h3>
work for color?
.my1 {display: block; text-align: center;}
.my2 {color: red;}

JSWolf
04-30-2012, 07:52 PM
Try your question on the Sigil forum. They have knowledgeable CSS folks over there.

http://www.mobileread.com/forums/forumdisplay.php?f=203

Regards - John

It's not a Sigil question. This is the right place for the question.

MarleneW
05-04-2012, 07:03 PM
The problem was me - I have made some progress by starting my CSS again - now getting some colour in text and table backgrounds using classes but finding it frustrating that apps read the code differently. EG FB reader does not show my sans serif font (or any sans serif font) and the others do, a link to another page attached to a graphic sometimes works and sometimes does not, and in IBooks display=inline block is ignored. Even photos are split across screens. My client is reluctant to specify a platform so I guess they will have to live with the differences in appearance between reader apps. (We are looking at Androids or Ipods mostly - Nooks and Kindle Fire are not available here)

Can anyone suggest how to hide a number of pages (chapter) from appearing in the TOC or navigation options? I have tried setting the spine settings to linear = NO whereupon other pages are not available.

Also cannot get anchors to work reliably in anything (Mantano, FB Reader, Galaxy Ebook, Ibooks)...

Jellby
05-05-2012, 04:22 AM
Fonts, unless they are embedded in the ebook, could or could not work in any reader, it depends on what they have predefined. "inline block" is not an officially supported value for ePub 2.

To hide things from the TOC, just remove them from the TOC. The TOC should be an NCX file which you can edit.

What doesn't work with anchors? I've never had a problem with them (except with pictures as links).

Iznogood
05-05-2012, 05:57 AM
Even photos are split across screens.

You could try to use this css property on a div containing the image:

page-break-inside:avoid !important;



Can anyone suggest how to hide a number of pages (chapter) from appearing in the TOC or navigation options? I have tried setting the spine settings to linear = NO whereupon other pages are not available.

The best way to not have a chapter in the toc is probably to not put it there in the first place. Simply remove the navpoint that discribes that chapter and update the playOrder for the rest of the chapters.

"Hidden" chapters I usually move to the end of the book, and make links to move between the chapters. The linear-property is the correct way of hiding stuff inside your book, bot the property is not honoured by the rendering machines

MarleneW
05-13-2012, 04:57 PM
Thank you for your comments - working on it