View Single Post
Old 03-26-2015, 05:39 PM   #3
bowlins
Member
bowlins began at the beginning.
 
Posts: 18
Karma: 10
Join Date: Jul 2014
Device: none
I've just been experimenting with widows and orphans and may have found a temporary workaround.

The solution is a bit precarious and I wouldn't trust it 100%. At first, the rules seemed to work. However, since webkit doesn't seem to support orphans/widows for screen media, I tested with more books and, indeed, the properties were buggy. They were breaking the text but the following trick seems to work for now:

Code:
div {
   page-break-after:avoid;
   page-break-before:avoid;
   page-break-inside:avoid;
}
p {
   page-break-after:avoid;
   widows: 2;
   orphans: 2;
}
On its own, widows and orphans seem to work on plain text. However, divs and images may change the flow and create broken text, paragraph duplication and other nasty bugs.

In my case, adding the page break rules for divs too seems to do the trick (for now)
bowlins is offline   Reply With Quote