![]() |
#1 |
Chief Bohemian Misfit
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 571
Karma: 462964
Join Date: May 2013
Device: iPad, ADE
|
Page breaks -- best practices?
Hey, folks...
I'm working on a Shakespeare book, and have run into a problem that I'm sure must be affecting all of my previous ebooks, too, but I just simply never noticed before -- it's only because I have a "header" image in this one that it suddenly became apparent. Attached here is a screenshot (from my iPad) of my title page and the first page (inline ToC), as it is at the moment (which might change). Both are in the same file, with a page-break in-between, but I have no idea why the header image gets bumped down a little after the page break. Here's the way I'm doing my page breaks now (which I'm sure I must have gotten from these forums at some point, since I don't think I would have come up with this way of doing it myself). In my HTML I have... Code:
<div class="pagebreak"> </div> Code:
.pagebreak { page-break-before: always !important; margin: 0; padding: 0; line-height:0; } I can upload a mini-version of my book with the first few pages, if necessary -- and thanks, as always, in advance! ![]() EDIT: Oh, I should probably have included the code for where those header images are, too. The HTML for that/those is... Code:
<p class="header"><img alt="ornament" src="../Images/header-black.gif"/></p> Code:
p.header { font-size:100%; line-height: 138%; margin-top: 0; margin-bottom: 1em; padding: 0; } Last edited by Psymon; 06-28-2016 at 03:26 AM. |
![]() |
![]() |
![]() |
#2 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 4,520
Karma: 121692313
Join Date: Oct 2009
Location: Heemskerk, NL
Device: PRS-T1, Kobo Touch, Kobo Aura
|
You should check the HTML and body tags in css. You can also use the @page selector to fix this.
|
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Obsessively Dedicated...
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3,221
Karma: 35037583
Join Date: May 2011
Location: PA {back in the usa!}
Device: Sony PRS-T2, ADE on PC
|
Does the
<div class="pagebreak"> </div> appear at the top of both pages? If it is only on the second page, that "empty" line is probably causing the drop. I think you should post the first two pages so the complete html is available for examination. |
![]() |
![]() |
![]() |
#4 | |
Chief Bohemian Misfit
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 571
Karma: 462964
Join Date: May 2013
Device: iPad, ADE
|
Quote:
Code:
@page { margin-top: 5px; margin-right: 5px; margin-left: 5px; } html>body { font-family: English, Georgia, 'Times New Roman', Times, serif; font-weight: normal; font-size: 100%; } body { font-family: English, Georgia, 'Times New Roman', Times, serif; font-weight: normal; font-size: 100%; line-height: 138%; margin: 0 0 0 0; } If that's what's causing that extra bit of space after a page break, wouldn't it also affect the very first page, too (i.e. the beginning of the HTML file)? |
|
![]() |
![]() |
![]() |
#5 | ||
Chief Bohemian Misfit
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 571
Karma: 462964
Join Date: May 2013
Device: iPad, ADE
|
Quote:
Quote:
|
||
![]() |
![]() |
Advert | |
|
![]() |
#6 |
Obsessively Dedicated...
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3,221
Karma: 35037583
Join Date: May 2011
Location: PA {back in the usa!}
Device: Sony PRS-T2, ADE on PC
|
I really do think (although Tox and other experts might see something else) it is that nbsp causing your trouble.
You don't need that in your div, you know. I have often used a "pagebreak" div like that, and always leave the div completely empty: <div style="page-break-before: always !important" /> OR <div class="pagebreak" /> Try it and let us know what happens. Last edited by GrannyGrump; 06-28-2016 at 04:44 AM. |
![]() |
![]() |
![]() |
#7 | ||
Chief Bohemian Misfit
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 571
Karma: 462964
Join Date: May 2013
Device: iPad, ADE
|
Quote:
Quote:
![]() ![]() |
||
![]() |
![]() |
![]() |
#8 |
Obsessively Dedicated...
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3,221
Karma: 35037583
Join Date: May 2011
Location: PA {back in the usa!}
Device: Sony PRS-T2, ADE on PC
|
Glad that worked. BTW, the book looks beautiful!
|
![]() |
![]() |
![]() |
#9 |
Chief Bohemian Misfit
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 571
Karma: 462964
Join Date: May 2013
Device: iPad, ADE
|
Thank you!
![]() ![]() |
![]() |
![]() |
![]() |
#10 |
Obsessively Dedicated...
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3,221
Karma: 35037583
Join Date: May 2011
Location: PA {back in the usa!}
Device: Sony PRS-T2, ADE on PC
|
I think it was your thread https://www.mobileread.com/forums/sho...-before&page=2
Look at posts 30 thru 33. The space was intended to force ADE to jump the "page number" up to the next digit. I don't know that that is such a critical issue, depends on which you consider worse: A page number repeated, or the top of page mis-aligned. You could always just split the file at each new page-break, and have multiple small files. (I do that after I have completed all editing with the book in a ginormous single file) Last edited by GrannyGrump; 06-28-2016 at 05:53 AM. |
![]() |
![]() |
![]() |
#11 |
A Hairy Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3,347
Karma: 20171571
Join Date: Dec 2012
Location: Charleston, SC today
Device: iPhone 15/11/X/6/iPad 1,2,Air & Air Pro/Surface Pro/Kindle PW & Fire
|
^^^ This. It makes it so much easier to navigate within Sigil, search/replace is much faster on smaller files, and it guarantees the start at the top of a new page. AFAIK there are some devices that don't always honor <page-break> as they should.
|
![]() |
![]() |
![]() |
#12 | |||
Chief Bohemian Misfit
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 571
Karma: 462964
Join Date: May 2013
Device: iPad, ADE
|
Well, this is strange, I know I replied to this already, but that reply seems to have disappeared! Or maybe I neglected to hit the submit button and closed my browser or something -- but that would be odd.
Anyway, I'll try to replicate my earlier reply... Quote:
In any case, the reason for adding in the nbsp into that div would appear to be from this comment from Jellby... https://www.mobileread.com/forums/sho...9&postcount=32 ...where he said that "For some renderers you may have to include some content in the <div>, or it will be discarded," and then putting that nbsp in there for "content." Looking at my original code, I'm surprised that just that nbsp did bump things down at all anyway, since my margins, padding and line-height were all set to "0" -- it's as though that was all ignored. Quote:
Also, from Turtle... Quote:
![]() I was really only planning on putting this book on the iBooks store anyway, perhaps I shouldn't be too concerned about whether the page breaks work (or not) in other devices -- although it's certainly nice if they do, if I ever change my mind about that. The issue over ADE inserting blank pages (as per that other thread) does bug me, though, if I were to go with separate files. |
|||
![]() |
![]() |
![]() |
#13 |
Obsessively Dedicated...
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3,221
Karma: 35037583
Join Date: May 2011
Location: PA {back in the usa!}
Device: Sony PRS-T2, ADE on PC
|
I guess when you speak of "inserting blank pages" you are talking about reading in a two-page // two-column mode. I only ever read in single-column mode, so I never even considered that issue (I'm only a hobbyist uploading free books, so "my way or the highway, baby"). I have never seen ADE on PC or my Sony reader insert blank pages.
I wonder if a poll would turn up a preponderance of users reading in two-page mode... |
![]() |
![]() |
![]() |
#14 | |
Chief Bohemian Misfit
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 571
Karma: 462964
Join Date: May 2013
Device: iPad, ADE
|
Quote:
https://www.mobileread.com/forums/sho...d.php?t=245061 |
|
![]() |
![]() |
![]() |
#15 |
Obsessively Dedicated...
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3,221
Karma: 35037583
Join Date: May 2011
Location: PA {back in the usa!}
Device: Sony PRS-T2, ADE on PC
|
If you need to have the nbsp content to preserve your page display --- just a thought for a kind of klunky kludge --- maybe, at the very top of the file --- if you put a simple div (no page-break) with nbsp, or a <br /> with nbsp on the <p> that holds the top image like so:
<p class="header"> <br /><img alt="ornament" src="../Images/header-red.gif" /></p> Then play with margin, font-size to get the same offset that displays after the programmatic page-break on the "catalogue" page. VERY inelegant, I know. ![]() |
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Help with page breaks? | Greg7976 | Sigil | 4 | 05-27-2013 07:52 AM |
Page Margin Best Practices epub->mobi | BKh | Conversion | 0 | 08-09-2012 12:11 PM |
epub to mobi h1 page breaks not starting on new page | wannabee | Conversion | 4 | 08-02-2011 12:46 AM |
Full page image best practices & TOC | illustrata | Sigil | 2 | 04-26-2011 01:50 PM |
Adding page breaks in Calibre breaks ePubcheck validation | bookraft | Conversion | 16 | 03-01-2011 01:23 PM |