View Single Post
Old 03-01-2021, 04:06 PM   #11
Tex2002ans
Wizard
Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.
 
Posts: 2,306
Karma: 13057279
Join Date: Jul 2012
Device: Kobo Forma, Nook
Quote:
Originally Posted by Turtle91 View Post
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.


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>
Chapter02.xhtml:

Code:
<h1>Chapter 2</h1>
<p>The next day was horrifying.</p>
That will work everywhere.

- - -

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>
CSS:

Code:
div.poem {
  page-break-inside: avoid;
}
Those that support it, great. They'll try to display the poem as one chunk.

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!
Tex2002ans is offline   Reply With Quote