I'm trying to make a page black background with white text but it doesn't work. (AZW3 format)

Any ideas for html code? I've tried both background and background-color and they don't work.

1 Answer 1


It's possible to make an AZW3 ebook (or a section of an ebook) to have black background and white text by adding style="background-color:black;color:white" to the <body> tag of the html file with text inside your AZW3.

The problem is whether your chosen e-reader will display the background. For example, the internal Calibre reader will happily show black pages with white text; on the other hand, my Kindle Paperwhite 3 will not respect the background-color setting on body, but will use the color parameter, rendering white text on white background and making the book unreadable!

Not ideal, to put it mildly.

To get around this, you can set the background color on a div wrapping the text. The downside is that there will always be a white border around the page, because both Calibre reader and Kindle seems to apply its own page borders and ignore any margin or padding settings on <body> or <html> tags.

If I really wanted to do this, I would set the background and text color on both body and a wrapper div - that way I'd get a nice black pages on compliant e-readers, and black rectangles on Kindle and co.

...and then I'd try to test it on as many e-readers as possible, because Murphy's law is a thing, and any styling that has the potential of rendering the content unreadable will probably do it. ;P

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.