epub.js icon indicating copy to clipboard operation
epub.js copied to clipboard

page-break-after: always not honored

Open keslert opened this issue 1 year ago • 2 comments

I have an epub that has each chapter wrapped in a section with the property page-break-after: always, but several of the chapters are getting rendered starting in the middle of the page.

Chapter V is the first chapter that is getting rendered mid page for me.

epub file: https://epubs.bookroo.com/happy-jack.epub

Screenshot 2023-10-05 at 9 35 40 PM

keslert avatar Oct 06 '23 01:10 keslert

See #261. page-break-after: always only works in paged media. In multicolumn layout, which Epub.js uses, the only way to force column breaks is replacing page-break-after: always with break-after: column (or -webkit-column-break-after: always). (But then you would no longer get page breaks when printing. AFAIKT, browsers don't support break-after: always or all, which is unfortunate.)

johnfactotum avatar Oct 06 '23 12:10 johnfactotum

Great, thanks for the explanation. I'll try one of those or break my chapters into their own files.

keslert avatar Oct 06 '23 13:10 keslert