View Full Version : Page Background Color in iBooks.


FunkeXMix
12-12-2012, 04:54 PM
Hi all,

I was wondering if 'css: background: black', for example is supported on Apple devices (epub). The original I am creating my eBook from has a couple of pages with black backgrounds and white text which I would like to recreate.

Also, would this pose any problem for acceptance to iBooks?

Thank you very much!

Aerys
12-12-2012, 08:59 PM
Yes it's supported by iBooks but the correct CSS should be "background-color:black" and no issue with submitting it to iTunes.

FunkeXMix
12-13-2012, 06:11 AM
Thanks for the answer but I am still a bit uneasy about it due to reading old topics about it: http://www.mobileread.com/forums/showthread.php?t=128117

Can someone confirm it works? Is text background and background image supported as well? I know these things work in KF8.

I needed to ask here because I could not find a source for it on google. Anybody know a page listing all supported CSS for iBooks?

Btw, at least for me this thread pops up when searching 'ibooks background color' on the first page with no other useful links. So could be a good source for others looking for the same info.

Thanks.

mzmm
12-13-2012, 09:26 AM
this works:

div { width:100%; height: 200px;}
.bg_img { background-image:url('img/linen.png'); background-repeat:repeat; }
.bg_color { background-color: orange; }

<div class="bg_img"></div>
<div class="bg_color"></div>

but it doesn't look like it supports the background shorthand.

edit -- forgot the image extension

this also works:

.bg_sh { background: transparent url('img/linen.png') no-repeat center center; }

<div class="bg_sh"></div>

as a caveat, you might want to test in night mode. seems like background colors (but not images) are overriden

_savage
12-19-2012, 02:03 AM
I used a .jpeg file as a background image for the BODY which rendered ok on the Nook (minus the white border around the display area) but it did not render in iBooks.

At the moment I am a bit where FunkeXMix come from: is it a good or acceptable approach to use background images or to color the background? I'm worried that this interferes with the reading experience and presets of a reader.

dgatwood
12-19-2012, 03:48 PM
IMO, using background color is acceptable as long as it is used sparingly for visual effect. You almost certainly should not use white-on-black for the body text of an entire book. :) One or two special pages in a book, however, are unlikely to annoy anyone.

I would also suggest setting !important on both the background and the color properties as a clear indication to the reading system that this is *not* ordinary body text that it can re-style at will without breaking things.

Even then, you might have a few buggy readers (Nook on iOS, I'm looking at you) that "helpfully" try to set the text color to black but don't change the background (resulting in black-on-black text). At least in the case of Nook on iOS, you can fix this by enabling publisher styles (and why that mode is not the default, I will never understand), but it is worth keeping in mind.

In iBooks on iPhone/iPad, inverted text behaves exactly as you would expect. Likewise in every other reader I tried except for Nook. *ahem*