|
|
#16 |
|
Resident Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 81,589
Karma: 150265991
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Of course I read what you wrote. But doing it with page breaks may or may not work. Not all programs for reading ePub follow the rules. So making a new HTML file works in all cases.
|
|
|
|
|
|
#17 |
|
Resident Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 81,589
Karma: 150265991
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
You need to stop with the webkit code that's not valid ePub code. If the program being used needs the webkit code, then it's broken and needs to be fixed.
|
|
|
|
| Advert | |
|
|
|
|
#18 |
|
Resident Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 81,589
Karma: 150265991
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
We know the page breaks will work with properly written programs. What you need to do is find dodgy programs and try them to see if they work.
|
|
|
|
|
|
#19 | |
|
Resident Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 81,589
Karma: 150265991
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Quote:
HTML code Code:
<h2>CHAPTER 1</h2> <p>There were four black and whites already at the 7-Eleven when I arrived. Several people had gathered in the parking lot behind the yellow police tape, huddling close for protection against the freezing Chicago rain.</p> <p>They weren’t there for Slurpees.</p> Code:
p {
margin-top: 0;
margin-bottom: 0;
widows: 1;
orphans: 1;
text-indent: 1.2em;
}
h2 + p, .noindent {
text-indent: 0;
}
|
|
|
|
|
|
|
#20 | |
|
A Hairy Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3,439
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
|
Quote:
For example: Code:
h1 {text-indent:0; font-size:1.2em; font-weight:bold; text-align:center; margin:0 0 2em;
page-break-after: avoid;
break-after: avoid;
break-after: avoid-column;
}
p {text-indent:1.2em; text-align:left; font-family:serif}
/* Or whatever your standard paragraph styling would be */
p.red {color:red}
p.banner {text-align:center; margin:2em 0; text-indent:0; color:blue}
<h1>This is a Header Line</h1>
<p>This is a normal paragraph.</p>
<p>This is a normal paragraph.</p>
<p>This is a normal paragraph.</p>
<p class="red">This is a normal paragraph with red color.</p>
<p>This is a normal paragraph.</p>
<p>This is a normal paragraph.</p>
<p>This is a normal paragraph.</p>
<p class="banner">This is a paragraph with blue color, centered, and extra margins above and below.</p>
<p>This is a normal paragraph.</p>
<p>This is a normal paragraph.</p>
<p>This is a normal paragraph.</p>
Code:
<h1 class="header">This is a Header Line</h1> <p class="para">This is a normal paragraph.</p> <p class="para">This is a normal paragraph.</p> <p class="para">This is a normal paragraph.</p> <p class="para red">This is a normal paragraph with red color.</p> <p class="para">This is a normal paragraph.</p> <p class="para">This is a normal paragraph.</p> <p class="para">This is a normal paragraph.</p> <p class="para banner">This is a paragraph with blue color, centered, and extra margins above and below.</p> <p class="para">This is a normal paragraph.</p> <p class="para">This is a normal paragraph.</p> <p class="para">This is a normal paragraph.</p> |
|
|
|
|
| Advert | |
|
|
|
|
#21 |
|
Zealot
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 106
Karma: 100000
Join Date: Dec 2024
Device: Tolino Shine 5
|
CSS page breaks in epub are a mess. I've tried to make them them work across ADE, Thorium, Calibre and Apple Books.
"break-after:column" is the modern property that is most widely supported (this requires column-fill: auto !important to be set for html and/or body). There is also "break-after: page" (sounds like it was intended for books) but they are not compatible with each other. When using both variants, the second one will override the first, no matter if it does anything or not. Kinda obvious, because it's the same property. "break-after: always" and "break-after: all" are supposed to break after pages and colums. They didn't work in any reading software I tried. There's also the legacy "page-break-after". It generally considered good practice include it for backwards compatibility. But apparently it can also override the page-break property. Here is a little compatibility chart: Code:
ADE Thorium Calibre Books break-after: always - - - - break-after: all - - - - break-after: page - - - x break-after: column x x x - page-break-after: - - x x Code:
PBA/BAC: x x x - PBA/BAP: - - - x BAC/PBA: - - x x BAC/BAP: - - - x BAP/BAC: x x x - PBA/BAP/BAC: x x x - PBA/BAC/BAP: - - - x BAP/BAC/PBA: - - x x BAC/BAP/PBA: - - x x BAC/PBA/BAP: - - - x BAP/PBA/BAC: x x x - "break-after: verso;" would be useful for books, but I haven't found any reading software that supports them, either. Last edited by Falkor; Yesterday at 04:44 PM. |
|
|
|
|
|
#22 | |
|
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,618
Karma: 11725368
Join Date: Aug 2010
Location: NE Oregon
Device: Kobo Sage, Pocketbook Era, Kobo Forma, Kindle Oasis 2
|
Quote:
Code:
break-after: avoid; break-after: avoid-column; /* This is for ereaders that employ multi-column to display pages */ -webkit-column-break-after: avoid; /* This is for ereaders that employ multicolumn to display pages */ |
|
|
|
|
|
|
#23 | |
|
Resident Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 81,589
Karma: 150265991
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Quote:
|
|
|
|
|
|
|
#24 | |
|
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,902
Karma: 8987599
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
|
Quote:
Today, virtually all epub3 readers mimic pagination using multi-columns, making the use of the "break-after|before: avoid-column" or "break-after|before: column" property (to force a break) almost indispensable. Of course, you also have the Webbit alternative. |
|
|
|
|
|
|
#25 |
|
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,745
Karma: 9501034
Join Date: Sep 2021
Location: Australia
Device: Kobo Libra 2
|
|
|
|
|
|
|
#26 | |
|
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,618
Karma: 11725368
Join Date: Aug 2010
Location: NE Oregon
Device: Kobo Sage, Pocketbook Era, Kobo Forma, Kindle Oasis 2
|
Quote:
I get paranoid, I've seen too many weird things happen, where all is fine, and then an ebook hits ONE app, where suddenly, things are not as I expect. Just this morning, I popped a book into the Google Books app ... only to find that some headings weren't centered. Yet, the heading tags all had: Code:
text-align: center; text-indent: 0; I don't recall having had that problem in the past in that app, actually, so maybe something changed there since I last made a book. It all makes my brain hurt! But I suppose it also all keeps my brain from rotting with disuse, LOL! |
|
|
|
|
|
|
#27 | |
|
Resident Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 81,589
Karma: 150265991
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Quote:
|
|
|
|
|
|
|
#28 |
|
Bibliophagist
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 49,564
Karma: 174632684
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
|
But what if I want to be able to support people using renderers that require the webkit codes? They seem to be treated as a null operation by other renderers and allows books to be read on more systems with formatting more or less as intended.
|
|
|
|
|
|
#29 |
|
Resident Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 81,589
Karma: 150265991
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Why would the renderer require webkit code if it's written properly to support ePub3? It should not need to. And besides, it's not valid code. It's not part of any ePub spec.
|
|
|
|
|
|
#30 | |
|
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,902
Karma: 8987599
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
|
Quote:
In that context: break-after: avoid: This is a generic property. Many e-readers ignore it because they don't know if you mean to avoid a physical page break, a region break, or a column break. break-after: avoid-column: This is much more specific. It explicitly tells the e-reader: "Don't break the column immediately after this element." Because it's a direct instruction to the box model the e-reader is using (columns), it's usually the only one they actually respect. Virtually any e-reader based on a web rendering engine (WebKit, Blink) uses this technique to simulate pages. The software tells the engine: "I have a container of infinite width and fixed height (the screen's width); divide it into columns the width of the screen." If you want to explore that model of pagination, you could read: https://deepwiki.com/readium/readium-css/3.1-pagination https://github.com/readium/css/blob/..._pagination.md but if you do a google search with "readium pagination and spreading" you'll have a lot of info about the subject. |
|
|
|
|
![]() |
|
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 |