Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Formats > ePub

Notices

Reply
 
Thread Tools Search this Thread
Old 06-27-2014, 03:44 PM   #1
medwatt
Enthusiast
medwatt began at the beginning.
 
Posts: 32
Karma: 10
Join Date: Jan 2011
Device: Kindle 3
Why android epub apps almost always disregard provided CSS

Hello,
I have been creating several ebooks with SIGIL. I leave the html code as clean as possible and control the appearance directly from a stylesheet. So instead of using inline styles for each paragraph I just use one selector for all paragraphs in the stylesheet. In Sigil the book looks exactly the way I want but when viewed in other software:
1. ADE - Headings and div tags are no longer centered, everything is indented (First paragraph should not be indented)
2. MoonReader - Line height is increased, headings are left aligned, no indentation whatsoever, open double quotes (&ldquo are converted to ".
3. Coolreader - Better than the rest in terms of CSS suport but doesn't load embedded font properly even though there's a tick box for that in the option menu.
4. Nook Simple touch - On the device the book looked best
5. Nook Simple touch android apk - not as in the device

I am not using any complicated css codes, just simple selectors and decedent selectors. I am really baffled why these readers seem to throw away my settings. I really hate reading a book that is not properly formatted.
In fact moonreader comes with 3 free wbooks and in all of them the text is left-justifed (no indentation). Really, who is making these software !! Surely, there's a reason why indentations were introduced in the first place.
Might it be possible that I should use inline styles instead?

Your inputs are welcomed and please recommend any android apk that supports even basic CSS (some pretend to).

Thanks

Last edited by medwatt; 06-27-2014 at 03:47 PM.
medwatt is offline   Reply With Quote
Old 06-27-2014, 04:45 PM   #2
theducks
Grand Sorcerer
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 14,241
Karma: 5495470
Join Date: Aug 2009
Location: The (original) Silicon Valley, USA
Device: Galaxy Tab 2, Astak Pocket Pro, K4NT
Moon reader Pro allows you to disable CSS styles ( OFF by default)
It also allows embedded fonts and other rules (3 pages of options to mess with )
theducks is online now   Reply With Quote
Old 06-27-2014, 05:37 PM   #3
Doitsu
Wizard
Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.
 
Doitsu's Avatar
 
Posts: 1,862
Karma: 4630359
Join Date: Dec 2010
Device: Kindle PW2
Bluefire Reader

Check out Bluefire Reader, it's based on the same engine that ADE uses. It definitely supports embedded fonts and CSS files.
I haven't tested the Android version, but the iOS version is pretty good.
Doitsu is offline   Reply With Quote
Old 06-27-2014, 05:38 PM   #4
medwatt
Enthusiast
medwatt began at the beginning.
 
Posts: 32
Karma: 10
Join Date: Jan 2011
Device: Kindle 3
Quote:
Originally Posted by theducks View Post
Moon reader Pro allows you to disable CSS styles ( OFF by default)
It also allows embedded fonts and other rules (3 pages of options to mess with )
Does MoonReader support external dictionaries like fora dictionary and goldendict. I read some foreign language books making the use of external dictionaries very important.
medwatt is offline   Reply With Quote
Old 06-27-2014, 06:06 PM   #5
Tex2002ans
Evangelist
Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.
 
Posts: 431
Karma: 360263
Join Date: Jul 2012
Device: Nook
Quote:
Originally Posted by Doitsu View Post
Check out Bluefire Reader, it's based on the same engine that ADE uses. It definitely supports embedded fonts and CSS files.
I haven't tested the Android version, but the iOS version is pretty good.
Mantano Reader is also based on RMSDK:

https://play.google.com/store/apps/d...oid.lite&hl=en

I prefer it over Bluefire.
Tex2002ans is offline   Reply With Quote
Old 06-27-2014, 06:38 PM   #6
medwatt
Enthusiast
medwatt began at the beginning.
 
Posts: 32
Karma: 10
Join Date: Jan 2011
Device: Kindle 3
I have noticed that when the styles are inline then the epub readers display them properly. For example: <p class="myStyle"> will cause the style to be used where as if I define p{} then it is ignored by the epub readers. Why is that so ?
I noticed this because I converted the book from epub to epub using Calibre software. Calibre adds a class to all html elements when when that is redundant. What's going on ?
medwatt is offline   Reply With Quote
Old 06-27-2014, 06:41 PM   #7
RbnJrg
Evangelist
RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.
 
Posts: 440
Karma: 299858
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
Quote:
Originally Posted by Tex2002ans View Post
Mantano Reader is also based on RMSDK:

https://play.google.com/store/apps/d...oid.lite&hl=en

I prefer it over Bluefire.
For my own experience, I can tell you that are very few the reader apps that observe the css stylesheet of an epub. I practically tested all of them and so far I found that the following apps as the better to read epubs:
  1. PocketBook Reader
  2. Aldiko
  3. Kobo

PocketBook doesn't support rounded box and pseudo-classes and pseudo-elements (no epub3 features), but has hyphenation and you can do "pinch" to adjust font-size, etc. On the other hand, Kobo supports rounded box and pseudo-classes but it hasn't hyphenation and is a bit slow (and no "pinch" at all, you need to do anything by menus). Finally, to read .mobi (or .azw3 files) the better is Kindle for Android; practically offers the same features as Kindle Fire.
RbnJrg is offline   Reply With Quote
Old 06-27-2014, 06:55 PM   #8
medwatt
Enthusiast
medwatt began at the beginning.
 
Posts: 32
Karma: 10
Join Date: Jan 2011
Device: Kindle 3
Is it a requirement that all styles be inline for epub readers ?
medwatt is offline   Reply With Quote
Old 06-27-2014, 07:35 PM   #9
theducks
Grand Sorcerer
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 14,241
Karma: 5495470
Join Date: Aug 2009
Location: The (original) Silicon Valley, USA
Device: Galaxy Tab 2, Astak Pocket Pro, K4NT
Quote:
Originally Posted by medwatt View Post
Does MoonReader support external dictionaries like fora dictionary and goldendict. I read some foreign language books making the use of external dictionaries very important.
I have no idea, I use a really old Websters that I keep under the desk in rare cases.
I only read English so I am the last one to ask on multiple language issues.
theducks is online now   Reply With Quote
Old 06-27-2014, 07:40 PM   #10
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: 8,756
Karma: 39465375
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Quote:
Originally Posted by medwatt View Post
1. ADE - Headings and div tags are no longer centered, everything is indented (First paragraph should not be indented)
Where did you find ADE for Android?

I've found ADE to be perfectly capable of centering headings and indenting all paragraphs but the first using nothing but simple CSS.

I format all my books the way I like them using CSS that's as simple as possible, and they all display as I intended them to. I'm mostly using Mantano these days (which is based on Adobe's RMSDK). All devices/renderers have quirks, but simple they don't really have too much trouble with.

Remember ... a single forgotten semi-colon, or other overlooked syntax error will cause ADE to ignore all CSS that comes after (Sigil's Webkit renderer is more forgiving). You should get used to validating your CSS (Sigil will connect to W3C's online validator for you) to eliminate the possibility of simple syntax errors. It's easy enough, and will save you hours of grief looking for what your eyes refuse to see sometimes.

Moon Reader (great app that it is) is all about allowing readers to defeat--or get around--the CSS imposed by an ebook's creator without having to actually edit the epub itself. As such, ebook creators who are trying to achieve a particular look for their project--using CSS--should probably steer clear of using it (Moon) to preview with (even with all its CSS overrides turned off). It's meant for readers who want to display things any which way EXCEPT the way you (its creator) intended it to be displayed. Nothing wrong with that, as long as you know it going in.

Last edited by DiapDealer; 06-27-2014 at 08:05 PM.
DiapDealer is offline   Reply With Quote
Old 06-27-2014, 07:58 PM   #11
RbnJrg
Evangelist
RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.
 
Posts: 440
Karma: 299858
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
Quote:
Originally Posted by medwatt View Post
Is it a requirement that all styles be inline for epub readers ?
AFAIK, no it isn't.
RbnJrg is offline   Reply With Quote
Old 06-27-2014, 08:41 PM   #12
medwatt
Enthusiast
medwatt began at the beginning.
 
Posts: 32
Karma: 10
Join Date: Jan 2011
Device: Kindle 3
Quote:
Originally Posted by DiapDealer View Post
Where did you find ADE for Android?

I've found ADE to be perfectly capable of centering headings and indenting all paragraphs but the first using nothing but simple CSS.

I format all my books the way I like them using CSS that's as simple as possible, and they all display as I intended them to. I'm mostly using Mantano these days (which is based on Adobe's RMSDK). All devices/renderers have quirks, but simple they don't really have too much trouble with.

Remember ... a single forgotten semi-colon, or other overlooked syntax error will cause ADE to ignore all CSS that comes after (Sigil's Webkit renderer is more forgiving). You should get used to validating your CSS (Sigil will connect to W3C's online validator for you) to eliminate the possibility of simple syntax errors. It's easy enough, and will save you hours of grief looking for what your eyes refuse to see sometimes.

Moon Reader (great app that it is) is all about allowing readers to defeat--or get around--the CSS imposed by an ebook's creator without having to actually edit the epub itself. As such, ebook creators who are trying to achieve a particular look for their project--using CSS--should probably steer clear of using it (Moon) to preview with (even with all its CSS overrides turned off). It's meant for readers who want to display things any which way EXCEPT the way you (its creator) intended it to be displayed. Nothing wrong with that, as long as you know it going in.
Can you provide me with a sample of an epub you created which makes use of an external stylesheet and not inline styles ?
medwatt is offline   Reply With Quote
Old 06-27-2014, 10:05 PM   #13
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: 8,756
Karma: 39465375
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Quote:
Originally Posted by medwatt View Post
Can you provide me with a sample of an epub you created which makes use of an external stylesheet and not inline styles ?
Sure.

Looks the way I expect it to in Sigil, ADE, Mantano, etc...

Hope something there helps.
Attached Files
File Type: epub simple_sample.epub (2.8 KB, 20 views)
DiapDealer is offline   Reply With Quote
Old 06-27-2014, 11:41 PM   #14
theducks
Grand Sorcerer
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 14,241
Karma: 5495470
Join Date: Aug 2009
Location: The (original) Silicon Valley, USA
Device: Galaxy Tab 2, Astak Pocket Pro, K4NT
Quote:
Originally Posted by medwatt View Post
Can you provide me with a sample of an epub you created which makes use of an external stylesheet and not inline styles ?
Every EPUB I touch has 1 or more CSS when I get done.

My primary reader is MRSDK (ADE) based. They render as designed. (As noted: 1 tiny CSS error and all bets are off. My PEz does not even like EPUB3 valid CSS entries. Pure EPUB 2 required)

Calibre conversions of those to AZW3 render fine on my K4NT

The few EPUB I have read with Moon + pro appear good
any time I have had problems was because there WAS A PROBLEM with MY coding
theducks is online now   Reply With Quote
Old 06-28-2014, 02:11 AM   #15
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 36,168
Karma: 17163730
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Sony Reader PRS-650, iPad, nook STR
Quote:
Originally Posted by medwatt View Post
I have noticed that when the styles are inline then the epub readers display them properly. For example: <p class="myStyle"> will cause the style to be used where as if I define p{} then it is ignored by the epub readers. Why is that so ?
I noticed this because I converted the book from epub to epub using Calibre software. Calibre adds a class to all html elements when when that is redundant. What's going on ?
I've defined p as I want and in the XML, when I want to use what I have defined, I make sure it's just <p>. Works on all ADE based readers I've used.

my p style is...
Code:
p {
margin-top: 0;
margin-bottom: 0;
text-indent: 1.2em
}
but when you use something like <p class="center"> to center something, you do have to have a text-indent: 0 in the class or it will be off center by 1.2em. Any class used with p that centers needs an indent of 0.
JSWolf is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
android pro quick guide apps: html5, CSS, regex... cybmole Sigil 10 05-13-2014 02:11 AM
Android epub apps nyy27wc Android Devices 0 11-21-2013 10:22 PM
CSS classes on Android epub readers MarleneW ePub 7 05-13-2012 04:57 PM
Override ePub CSS with userStyle.css? barium Sony Reader Dev Corner 11 07-16-2011 03:25 PM


All times are GMT -4. The time now is 07:36 PM.


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