Quote:
Originally Posted by icearch
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?
|
You should use:
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 */
The same for break-before and break-inside. So, if for example you want to avoid a break after a h* tag, then you should use the following style:
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 */
}
and
Code:
<h2 class="break_avoid">This is a Title</h2>
<p>Blah, blah, blah... (a long paragraph)</p>
Try this code in Calibre, Thorium, ADE, Sigil's plugins (Readium, BibiReader, JSReader), KOReader, Kobo for Android, Lithium, Reasily, PocketBook, Cantook, Infinity Reader. BookFusion.
If you don't want to use -webkit-column-break-after: avoid, then use:
Code:
break-after: avoid-column
but your style must have one of them. Of that way, an alternative style would be:
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 */
}