|
|
#1 |
|
Connoisseur
![]() Posts: 54
Karma: 10
Join Date: Nov 2025
Device: none
|
About page-break
page-break-after
page-break-before page-break-inside How well are they supported in epub3 and 2 now? I have used them in some case but they tend to fail. The only certain way I know to let content start in a new page is creating a new xhtml file. But some web novel can have 1000 chapters, it's tedious to have 1000 xhtml files. So how well are they work exactly now? How can I guarantee a page break? |
|
|
|
|
|
#2 |
|
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,744
Karma: 9501034
Join Date: Sep 2021
Location: Australia
Device: Kobo Libra 2
|
Those tags are deprecate:
https://developer.mozilla.org/en-US/...e-break-inside Should use: https://developer.mozilla.org/en-US/...s/break-inside Though the Libra2 does not recognise the newer tag and still prefers the deprecated tag. Use both tags in your CSS. Something like this... .nopagebreak { break-inside: avoid; page-break-inside: avoid; } |
|
|
|
|
|
#3 | |
|
Resident Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 81,556
Karma: 150265991
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Quote:
|
|
|
|
|
|
|
#4 |
|
Connoisseur
![]() Posts: 54
Karma: 10
Join Date: Nov 2025
Device: none
|
The tutorial I see is so old...
I'm going to try break before and after later. Thank you. |
|
|
|
|
|
#5 |
|
Connoisseur
![]() Posts: 54
Karma: 10
Join Date: Nov 2025
Device: none
|
|
|
|
|
|
|
#6 | |
|
Connoisseur
![]() Posts: 54
Karma: 10
Join Date: Nov 2025
Device: none
|
Quote:
At least in Sigil's readium plugin. Does this have something to do with the plugin? Or it will happen in other readers out there? |
|
|
|
|
|
|
#7 |
|
Connoisseur
![]() Posts: 54
Karma: 10
Join Date: Nov 2025
Device: none
|
And more test, yes, lot's of reader software does not work. Some do though.
Why it is so hard to put such basic and simple function to work? |
|
|
|
|
|
#8 | |
|
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 5,891
Karma: 106187745
Join Date: Apr 2011
Device: pb360
|
Quote:
|
|
|
|
|
|
|
#9 | |
|
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,899
Karma: 8939999
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
|
Quote:
Code:
page-break-after: always|avoid; /* This is for epub2 (ADE RMSDK) */ break-after: always|avoid; /* This is for epub3 */ -webkit-column-break-after: always|avoid; /* This is for epub3, for ereaders that use webkit rendering engine */ Code:
.break_avoid {
page-break-after: avoid; /* This is ignored by epub3 */
break-after: avoid; /* This is ignored by epub2 */
-webkit-column-break-after: avoid; /* This is ignored by epub2 */
}
Code:
<h2 class="break_avoid">This is a Title</h2> <p>Blah, blah, blah... (a long paragraph)</p> If you don't want to use -webkit-column-break-after: avoid, then use: Code:
break-after: avoid-column Code:
.break_avoid {
page-break-after: avoid; /* This is ignored by epub3 */
break-after: avoid; /* This is ignored by epub2 */
break-after: avoid-column; /* This is ignored by epub2 */
}
|
|
|
|
|
|
|
#10 | |
|
Connoisseur
![]() Posts: 54
Karma: 10
Join Date: Nov 2025
Device: none
|
Quote:
Like, who in the hell would thought of that? Our final solution are just like yours, but add !important after each value, so it can have higher priority. Thank you very much for your detailed explanation! |
|
|
|
|
|
|
#11 |
|
Connoisseur
![]() Posts: 54
Karma: 10
Join Date: Nov 2025
Device: none
|
By the way, the reader plugins in Sigil are pretty old, like the last update is in 2023, and the whole readium homepage in Github just vanished?
Is there any new / better reader plugin or whole other new ways to verify the file I'm making on the fly? |
|
|
|
|
|
#12 | |
|
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,899
Karma: 8939999
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
|
Quote:
|
|
|
|
|
|
|
#13 | ||||
|
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,899
Karma: 8939999
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
|
Quote:
Code:
break-after: avoid; -webkit-column-break-after: avoid; /* This is for ereaders that employ multicolumn to display pages */ Code:
break-after: avoid; break-after: avoid-column; /* This is for ereaders that employ multi-column to display pages */ Quote:
![]() Quote:
Quote:
|
||||
|
|
|
|
|
#14 |
|
A Hairy Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3,438
Karma: 20456789
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
|
The only addition I would make is if you are trying to force/avoid a break after every xxxx element, then just add the code to that element’s css rather than adding a class to all of them. That cleans up your html a bit.
Of course, you could keep the code as its own class as well for those one-off elements that might need it. |
|
|
|
![]() |
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| page-break-before: always; | avresbo | Kobo Reader | 1 | 03-02-2023 09:30 AM |
| Do you use page-break-after and page-break-inside? | fluoresce | ePub | 14 | 05-24-2017 02:57 AM |
| No page break for H2 | RickAltman | Calibre | 2 | 06-25-2012 12:02 PM |
| PAGE BREAK | JFS-NMF | Recipes | 0 | 03-04-2011 10:15 AM |
| Page break before <b> | flowoeB | Calibre | 14 | 04-12-2009 04:05 PM |