title_body: 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 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...
  
  &lt;span style="color: #f00;"&gt;Make me yellow!&lt;/span&gt;
  
  
  ...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.
upvoted_answer: 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&amp;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.