Quote:
Originally Posted by PilcrowandStanza
Hi all,
There has to be a simple fix for this, right?
Titles/headers at the bottom of the page with the text starting on the next.
How to keep them together! I use CSS "page break: avoid" to little luck.
Is there extra code that needs to be added?
Or do we simply accept that ebooks are wonky?
Thanks
|
Employ the following style:
1. In your .css stylesheet:
Code:
.noBreakAfter {
-webkit-column-break-after: avoid; /* This is for epub3, epub2 ebooks will ignore it */
page-break-after: avoid; /* This is for epub2; epub3 ebooks will ignore it */
break-after: avoid; /* Also for epub3 */
}
2. In your .xhtml:
Code:
<h2 class="noBreakAfter">Your title here</h2>
<p>Your following text here ... </p>
Of course, if you don't want to create a style, you also can write the following in your .css:
Code:
h1, h2, h3, h4, h5, h6 {
-webkit-column-break-after: avoid;
page-break-after: avoid;
break-after: avoid;
}
EDIT: Which e-reader are you going to use this feature on?