View Single Post
Old 07-18-2022, 04:32 PM   #8
Tex2002ans
Wizard
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: 2,306
Karma: 13057279
Join Date: Jul 2012
Device: Kobo Forma, Nook
Quote:
Originally Posted by bbacle View Post
Is there a way when creating an ebook that I can have a background color [...] behind my text
Yes, you'll want to use the background-color CSS:

HTML:

Code:
<div class="red">
	<p>This is going to have a red background.</p>
</div>

<p class="blue">This is a blue background too.</p>
CSS:

Code:
div.red {
	background-color: red;
}

p.blue {
	background-color: blue;
}
Quote:
Originally Posted by Quoth View Post
But consider if it's a good idea. Usually it's not.
Yes, I agree.

It would be good to know WHY bbacle is trying to get a color/image as the background... then we can give more details.

Quote:
Originally Posted by bbacle View Post
Is there a way when creating an ebook that I can have [...] image behind my text?
Putting images behind text is a horrible idea + very buggy.

For all the details, see this previous discussion:

Quote:
Originally Posted by JSWolf View Post
If there's a chance this ePub will be read on an eInk screen, don't do it with a background color or image. It will most likely not work well.
Agreed. Strongly advise against using colored backgrounds.

If you do use colors, you have to be very careful with contrast between font+background color.

And remember, people do read using things like Night Mode.

For more info on that, see:

And if you want to see the "colored box" CSS I used way back when, you can see:

Not much has changed on that front.
Tex2002ans is offline   Reply With Quote