View Single Post
Old 11-28-2023, 09:07 PM   #5
azimuth
Enthusiast
azimuth plays well with othersazimuth plays well with othersazimuth plays well with othersazimuth plays well with othersazimuth plays well with othersazimuth plays well with othersazimuth plays well with othersazimuth plays well with othersazimuth plays well with othersazimuth plays well with othersazimuth plays well with others
 
Posts: 33
Karma: 2538
Join Date: Aug 2023
Location: NW US
Device: none
What's the header tags [h1-h6] CSS setup look like in your epub? Do show your CSS code here (and how the h1-h6 are set on the xhtml page) so people here can suggest a more concise solution, otherwise it's just a rough guess or suggestion tossed into a pot, which may/or may not solve it. The CSS/xhtml code is readily accessible in Calibre in the code editor. Plus, even a snapshot visual can help a lot.

MobileRead Wiki CSS template suggests the following for headings to minimize the chance of it breaking after it.
Code:
h1, h2, h3, h4, h5, h6 {
  page-break-after: avoid; /* fallback */
  break-after: avoid;
  ...etc
}

Alternate concept is to group your key items on same page - the book title, author name, publisher name - wrapped in a DIV, add special CSS for it (yet this goes beyond what the CSS h1-h6 default behavior naturally does - and u must do further steps to control the image).
Code:
.element { 
  page-break-inside: avoid;
  page-break: avoid;
}
<div class="element">
  <h1>Title</h1>
  <h4>Author</h4>
  <h5>Publisher</h5>
  <p>Short line of text</p>
  <img src="logo.png" class="logo"/>
</div>

Last edited by azimuth; 11-29-2023 at 12:54 AM.
azimuth is offline   Reply With Quote