![]() |
#1 |
Connoisseur
![]() Posts: 68
Karma: 10
Join Date: Feb 2010
Device: none
|
page-break-after: always not working
Hallo
I made some experiments in an ebook's css-file (an epub) with the css property "page-break-after" and "page-break-before" like this: Code:
... .endofsite { page-break-after: always; } .beginofsite { page-break-before: always; } Tried it with calibre reader and MoonReader, neither are doing pagebreak. Is there a way beside of creating a new html-file that my readers are doing a page break? Thanks for hints. frank |
![]() |
![]() |
![]() |
#2 |
A Hairy Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3,312
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
|
Sorry, page-break-before/after are not supported consistently. The only way I am aware of forcing it is by having a new html page.
|
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 7,032
Karma: 91577715
Join Date: Nov 2011
Location: Charlottesville, VA
Device: Kindles
|
It does work in the calibre reader if coded correctly. I suspect that there is a problem with either the linking of the style sheet or calling out the class from the HTML.
|
![]() |
![]() |
![]() |
#4 |
Obsessively Dedicated...
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3,202
Karma: 34984330
Join Date: May 2011
Location: JAPAN (US expatriate)
Device: Sony PRS-T2, ADE on PC
|
@ franc --- this may or may not be of help -----
If you are working with epub2, you might take a look at this old thread: https://www.mobileread.com/forums/sh...d.php?t=270007 If you have a <hr /> or an empty <div> before the "beginofsite" class, you might get spotty results. I am not sure if the same problem would arise if you have <hr /> or empty div after "endofsite". EDIT TO ADD --- Yes, I just checked --- same problem if <hr /> or empty div comes directly after "endofsite". As RbnJrg pointed out, I had to add a <p> with some *text* in it before the page-break-before , even if that text was only a non-breaking space. You could set font-size to .05em to make it virtually invisible. You could also play with the display: none, or visible: hidden; although I never tried those, they might work to hide that paragraph if you need it hidden. The book in question is posted here in the library https://www.mobileread.com/forums/sh...d.php?t=270214 Hope you can get it worked out. Last edited by GrannyGrump; 03-01-2021 at 07:48 AM. |
![]() |
![]() |
![]() |
#5 | |||
Connoisseur
![]() Posts: 68
Karma: 10
Join Date: Feb 2010
Device: none
|
Quote:
![]() Quote:
See my attached epub example. The class works, but not the page-break-after attribute. Quote:
Thank anyway! frank |
|||
![]() |
![]() |
Advert | |
|
![]() |
#6 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 7,032
Karma: 91577715
Join Date: Nov 2011
Location: Charlottesville, VA
Device: Kindles
|
Your sample works for me in the calibre viewer.
|
![]() |
![]() |
![]() |
#7 |
Bibliophagist
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 44,814
Karma: 168802811
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
|
What version of calibre viewer and OS are you using?
|
![]() |
![]() |
![]() |
#8 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 7,032
Karma: 91577715
Join Date: Nov 2011
Location: Charlottesville, VA
Device: Kindles
|
Make sure that the calibre viewer is not in flow mode.
|
![]() |
![]() |
![]() |
#9 |
Connoisseur
![]() Posts: 68
Karma: 10
Join Date: Feb 2010
Device: none
|
AHH! Sorry, that it is. Yes, then, calibre works then too
![]() ![]() Sorry. Flow mode is it. I guess the MoonReader is the same thing, there too, there is a flow mode, which I love, because I can set an exact position of reading. Not many reader can do this. So I guess then either flow mode or (soft) page break (with css) possible. Many thanks! PS.: Calibre 3.48 on Mac (last working on 10.11) and the last 4.x (because of DeDRM) on Windows 10. |
![]() |
![]() |
![]() |
#10 | |
Resident Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 79,130
Karma: 144284184
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Quote:
|
|
![]() |
![]() |
![]() |
#11 | |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,306
Karma: 13057279
Join Date: Jul 2012
Device: Kobo Forma, Nook
|
Quote:
![]() In real life, many ereaders don't support the page-break CSS. If the break is "mandatory" for something like a chapter break, best to do like Turtle91 recommended: New HTML file per chapter. Chapter01.xhtml: Code:
<h1>Chapter 1</h1> <p>It was a dark and stormy night.</p> Code:
<h1>Chapter 2</h1> <p>The next day was horrifying.</p> - - - If it's "optional" (like breaking before/after a diagram or poem, etc.), then you could still keep the page-break: Code:
<p>This is a poem:</p> <div class="poem"> <p class="stanza">The cows are green.</p> <p class="stanza">The cows are red.</p> <p class="stanza">The cows are blue.</p> </div> Code:
div.poem { page-break-inside: avoid; } Those that don't support it (the vast majority)... okay. Having the CSS there won't hurt, and in the future, as support gets better, your ebook will already handle it! ![]() |
|
![]() |
![]() |
![]() |
#12 | |
Connoisseur
![]() Posts: 68
Karma: 10
Join Date: Feb 2010
Device: none
|
Quote:
![]() I dont share databases with Mac and PC, I even dont know how that works ![]() I use calibre only to convert books or to DeDRM books ![]() Reading books I do only on my phone with MoonReader. It would be great if calibre could use the same books than my phone, which I backup on Google Drive but than I would need to use Google Drive Sync on my PC and Mac too, that I dont want. Thank you Tex2002ans too for your explanations. frank |
|
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
page-break-after avoid not working | scruffs | Amazon Kindle | 50 | 01-27-2023 06:28 AM |
Do you use page-break-after and page-break-inside? | fluoresce | ePub | 14 | 05-24-2017 01:57 AM |
Mobi & AZW Page Break NOT working | uieluck | Workshop | 36 | 11-14-2014 12:03 PM |
iPad iBooks: page-break-after/inside/before NOT working? | philx | Apple Devices | 7 | 01-27-2013 12:42 AM |
Page break before <b> | flowoeB | Calibre | 14 | 04-12-2009 03:05 PM |