![]() |
#1 |
Connoisseur
![]() Posts: 96
Karma: 10
Join Date: Mar 2014
Device: none
|
Box divided between two pages
I have defined a text box like this:
Code:
<style> div.box1 { width: 20em; background-color:#D1D3D4; border-bottom: 3px double; border-top: 3px double; border-left: 3px double; border-right: 3px double; padding: 1em; margin-top: 1em; line-height: 1.7em; text-align: center; float: right; } </style> <div class="box1">Yadda, yadda, yadda, yadda, yadda, yadda.</div> <div style="clear:both;"></div> In the editor it always looks fine, but then when I look at the book on my iPad using iBooks, that's when I see the problem. |
![]() |
![]() |
![]() |
#2 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 4,520
Karma: 121692313
Join Date: Oct 2009
Location: Heemskerk, NL
Device: PRS-T1, Kobo Touch, Kobo Aura
|
You could add 'page-break-inside: avoid' to the div class. No guarantee though, it is not supported on all devices. It probably is in iBooks.
|
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Connoisseur
![]() Posts: 96
Karma: 10
Join Date: Mar 2014
Device: none
|
thanks... will give that a shot
![]() |
![]() |
![]() |
![]() |
#4 |
Connoisseur
![]() Posts: 96
Karma: 10
Join Date: Mar 2014
Device: none
|
OK, sorry for the daft question (and yes, I know I should be ashamed of myself...), how do I actually add that string to the "div class"?
|
![]() |
![]() |
![]() |
#5 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 4,520
Karma: 121692313
Join Date: Oct 2009
Location: Heemskerk, NL
Device: PRS-T1, Kobo Touch, Kobo Aura
|
Err, in the stylesheet of course. You already gave a style definition for the div (box1). Just add it to it.
|
![]() |
![]() |
Advert | |
|
![]() |
#6 | |
Connoisseur
![]() Posts: 96
Karma: 10
Join Date: Mar 2014
Device: none
|
This is what (I think) I have done...
I have now this: Code:
<div class="box1" page-break-inside: avoid> Quote:
|
|
![]() |
![]() |
![]() |
#7 |
Well trained by Cats
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 31,067
Karma: 60358908
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
|
![]() |
![]() |
![]() |
#8 |
Connoisseur
![]() Posts: 96
Karma: 10
Join Date: Mar 2014
Device: none
|
Erm... it is not in the stylesheet... It is all in there, in the file itself.
(Please, no swearing at the screen ... ![]() Last edited by Arkadian; 09-12-2014 at 02:06 PM. |
![]() |
![]() |
![]() |
#9 |
Color me gone
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,089
Karma: 1445295
Join Date: Apr 2008
Location: Central Oregon Coast
Device: PRS-300
|
between the style tags at the top of document.
|
![]() |
![]() |
![]() |
#10 |
Well trained by Cats
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 31,067
Karma: 60358908
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
|
![]() |
![]() |
![]() |
#11 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 4,520
Karma: 121692313
Join Date: Oct 2009
Location: Heemskerk, NL
Device: PRS-T1, Kobo Touch, Kobo Aura
|
Don't take this wrong, but perhaps a crash course HTML/CSS would be a good idea for the general ideas...
To spell it out: Code:
<style> div.box1 { width: 20em; background-color:#D1D3D4; border-bottom: 3px double; border-top: 3px double; border-left: 3px double; border-right: 3px double; padding: 1em; margin-top: 1em; line-height: 1.7em; text-align: center; float: right; page-break-inside: avoid; } </style> <div class="box1">Yadda, yadda, yadda, yadda, yadda, yadda.</div> <div style="clear:both;"></div> |
![]() |
![]() |
![]() |
#12 |
Connoisseur
![]() Posts: 96
Karma: 10
Join Date: Mar 2014
Device: none
|
Ok, assuming there was a need to stress it further, I am a TOTAL dope
![]() I have tried one chapter only, but I am hopeful now ![]() |
![]() |
![]() |
![]() |
#13 | |
Well trained by Cats
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 31,067
Karma: 60358908
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
Quote:
fix it once in the sheet, check for exceptions ![]() |
|
![]() |
![]() |
![]() |
#14 |
Connoisseur
![]() Posts: 96
Karma: 10
Join Date: Mar 2014
Device: none
|
Indeed so...
|
![]() |
![]() |
![]() |
#15 |
Color me gone
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,089
Karma: 1445295
Join Date: Apr 2008
Location: Central Oregon Coast
Device: PRS-300
|
Not hard to do either. Copy all the stuff between the style tags. Paste it into notepad or something similar and save it as yourchoiceoffilename.css.
Then use calibre or sigil to open the document. Eliminate the same stuff, including the style tags this time in each section. Then import your new css file and the last step is linking each file to this spreadsheet. It is easy to do this all at once by selecting all the sections. You can also export a stylesheet and save it then you can use it over again. When you alter it with new stuff, save it again so you can use all your new updates in your next project. You might not want to link the very first file in your epub to this overall stylesheet. It is often a titlepage where you might want each line to be spaced much wider from its predecessor. You can save this special stylesheet separate and reuse it in your following ones. That way once you have solved a problem, you can bring your solution very easily into your latest effort. In any case, when you used a linked stylesheet, a change in this main stylesheet corrects all, so all captions look the same, all pictures are handled the same etc, as the ducks noted. |
![]() |
![]() |
![]() |
Thread Tools | Search this Thread |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
A Mother's Sacrifice for Racially Divided Children | TwoKindsofColor | Self-Promotions by Authors and Publishers | 32 | 06-30-2012 12:24 PM |
PDF pages in a box | Mamaijee | Calibre | 4 | 01-10-2011 10:37 PM |
The Divided Man, a Novel of the Ghost Dance | JohnSauer | Self-Promotions by Authors and Publishers | 2 | 12-20-2010 09:23 AM |
Historical Fiction Henty, George Alfred: Friends, though divided. V1. 2 May 2010 | crutledge | ePub Books | 0 | 05-02-2010 12:16 PM |
Publishers 'completely divided' over e-book pricing | DMcCunney | News | 71 | 10-17-2009 05:48 PM |