View Single Post
Old 05-07-2016, 06:31 PM   #2
RbnJrg
Wizard
RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.
 
Posts: 1,875
Karma: 8821117
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
Quote:
Originally Posted by MacEachaidh View Post
I understand in principle how to use text boxes and background colours. I don't want to use text boxes in an epub, since I want the text still to be able to flow, but I'd like to emulate the look to some degree.

So: is there any way to have the background colour stretch margin to margin, even though the text in front of it is indented by, say, 1 em on both sides?
Also, to have the colour start maybe a line before the para text, without having to use clunky approaches like empty paragraphs?

I assume this would require making the colour a separate element from the paragraph, rather than a property of the para itself, but I don't know who to do that.

Thanks for any help.
Something like this?

Click image for larger version

Name:	Image1.png
Views:	362
Size:	74.9 KB
ID:	148527

You can get that effect by giving the property "background: yellow" (or the color you want) to the body tag. Write the following in your css stylesheet:

Code:
body {
   background: yellow;
   margin: 0 25px;
}
Below you can check the respective epub so you can understand better the code I used.

Regards
Rubén
Attached Files
File Type: epub Background Color.epub (2.5 KB, 369 views)
RbnJrg is offline   Reply With Quote