
: Overriding Device Styles On some epub devices, you can change the background color to black, with the font switching to white. My iBook program allows four distinct styles. Is there a way to
On some epub devices, you can change the background color to black, with the font switching to white. My iBook program allows four distinct styles.
Is there a way to override these styles for particular elements? For example, I'm converting a book that's in the public domain to an epub. I'm adding a few notes, which I style (red text) to indicate those notes were written by me, not the original author.
But if I switch to dark mode, my styles are lost. If I insert a style directly into my text, like this...
<span style="color: #f00 ;">Make me yellow!</span>
...even that is overriden.
Is there a special CSS style that can override these custom backgrounds, or are the backgrounds controlled by JavaScript or some other programming language?
P.S. There is at least one workaround of sorts. Device styles don't appear to affect border colors. If I style a paragraph with a red border, for example, then the border remains red when I preview my epub. I haven't tested it in all devices, however.
Free books android app tbrJar TBR JAR Read Free books online gutenberg
More posts by @Angie

: Can I split chapters with CSS? I'm learning to create epubs with InDesign. If you want a particular element inside a chapter (e.g. a subheading) to appear at the top of the next page, you

: Rich e-book authoring, other than iBooks Author? i am writing (or should i say, developing) an ebook on iBooks Author with all the cool features it provides. After this I wanted to do a version
1 Comments
Sorted by latest first Latest Oldest Best
Every device works in a different way, I don't think that there are standards regarding the programming of the software that they are equipped with.
Besides that, almost every e-reading device and software allow some form of user customization over the display of the text, and AFAIK, you can't prevent this by coding inside the ebook. If you use styles that serve some functional purpose and not just for aesthetics (like your example, to differentiate between different kind of notes), your best option is to add a disclaimer on the first pages stating that if the user chooses to apply his customization, the intended experience/functionality can be compromised.
Usually the ereader, to know how to display the text, looks for these things in this order:
User customization of the ereader
Styles as defined in the CSS inside the ebook
The default ereader settings
Furthermore, keep in mind that often ebooks are read on B&W eink devices that can't display colored text.
If you need to differentiate between, i.e., author's notes and editor's notes, I would use some kind of abbreviation like A.N. and E.N, or a different font style setting (i.e. normal and italic, a different font), and with a disclaimer like said before.
Free books android app tbrJar TBR JAR Read Free books online gutenberg