05-09-2017, 07:43 AM | #1 |
Enthusiast
Posts: 38
Karma: 342440
Join Date: Apr 2017
Device: Sigil
|
Do you use page-break-after and page-break-inside?
I have used the following lines of CSS code in my EPUB:
Code:
h2, h3, h4, h5, h6 { page-break-inside: avoid; page-break-after: avoid; } It would be interesting to hear your opinions. Should I not use this code? Can it cause problems? Is it well supported? Another question . . . Do you guys switch off hyphenation? |
05-09-2017, 08:02 AM | #2 | |
Wizard
Posts: 1,548
Karma: 6613969
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
|
Quote:
And regarding hyphenation, I disable it for <h> tags. |
|
Advert | |
|
05-09-2017, 10:16 AM | #3 |
Wizard
Posts: 4,520
Karma: 121692313
Join Date: Oct 2009
Location: Heemskerk, NL
Device: PRS-T1, Kobo Touch, Kobo Aura
|
Most readers will ignore it though, even if they use RMSDK.
|
05-09-2017, 02:50 PM | #4 |
A Hairy Wizard
Posts: 3,099
Karma: 18727053
Join Date: Dec 2012
Location: Charleston, SC today
Device: iPhone 11/X/6/iPad 1,2,Air & Air Pro/Surface Pro/Kindle PW & Fire
|
Having those in there, on the other hand, shouldn't be a problem. A compliant reader/app should gracefully degrade...meaning if it doesn't understand or support a css command it shouldn't break. If your app is breaking over the code then that should be reported as a bug.
|
05-09-2017, 06:28 PM | #5 |
Enthusiast
Posts: 38
Karma: 342440
Join Date: Apr 2017
Device: Sigil
|
Thanks, guys. I shall leave it in there. If I hear of any problems, then I'll remove it. I shall not switch off hyphenation, either.
|
Advert | |
|
05-09-2017, 10:52 PM | #6 |
Wizard
Posts: 3,413
Karma: 13369310
Join Date: May 2008
Location: Launceston, Tasmania
Device: Sony PRS T3, Kobo Glo, Kindle Touch, iPad, Samsung SB 2 tablet
|
I have these lines in the CSS I use
.avoidbreak { page-break-inside: avoid; } .breakabove { page-break-before:always; } .breakafter { page-break-after:always; } and use them, nearly always as div classes, and find they work on my Sony T3, Kobo Glow, Kindle, iPad, and Samsung tablet. So far as I can tell they've always worked - e.g. a div with the class .breakabove always starts on a new page. Could you tell me please how you turn off hyphenation? That would be really useful for long titles if it stops a word from breaking. |
05-09-2017, 11:06 PM | #7 | |
A Hairy Wizard
Posts: 3,099
Karma: 18727053
Join Date: Dec 2012
Location: Charleston, SC today
Device: iPhone 11/X/6/iPad 1,2,Air & Air Pro/Surface Pro/Kindle PW & Fire
|
Quote:
Code:
-moz-hyphens: none; -ms-hyphens: none; -webkit-hyphens: none; hyphens: none; |
|
05-10-2017, 03:24 AM | #8 | |
Wizard
Posts: 3,413
Karma: 13369310
Join Date: May 2008
Location: Launceston, Tasmania
Device: Sony PRS T3, Kobo Glo, Kindle Touch, iPad, Samsung SB 2 tablet
|
Quote:
|
|
05-16-2017, 07:29 PM | #9 | |
Resident Curmudgeon
Posts: 74,027
Karma: 129333114
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Quote:
Also, for Sony you have to mention which model as up until the T3, there was no hyphenation and thus, they had gaps in some lines when full justified. So they didn't always look good. |
|
05-16-2017, 07:30 PM | #10 | |
Resident Curmudgeon
Posts: 74,027
Karma: 129333114
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Quote:
|
|
05-17-2017, 09:47 AM | #11 | |
A Hairy Wizard
Posts: 3,099
Karma: 18727053
Join Date: Dec 2012
Location: Charleston, SC today
Device: iPhone 11/X/6/iPad 1,2,Air & Air Pro/Surface Pro/Kindle PW & Fire
|
Quote:
You can fine tune these commands to only turn off hyphenation for certain parts...just put the tags in the appropriate CSS. Of course, the reader/app may completely ignore it anyway.... Last edited by Turtle91; 05-17-2017 at 09:52 AM. |
|
05-17-2017, 09:50 AM | #12 |
A Hairy Wizard
Posts: 3,099
Karma: 18727053
Join Date: Dec 2012
Location: Charleston, SC today
Device: iPhone 11/X/6/iPad 1,2,Air & Air Pro/Surface Pro/Kindle PW & Fire
|
While I don't get over this use, Jon has a point. It's better if you say iBooks if you are disparaging the way a book renders than "iPad". There are several apps that display on iPads that render very well. I use Marvin on all of my iOS devices and it does splendidly!
|
05-17-2017, 09:19 PM | #13 | |
Wizard
Posts: 3,413
Karma: 13369310
Join Date: May 2008
Location: Launceston, Tasmania
Device: Sony PRS T3, Kobo Glo, Kindle Touch, iPad, Samsung SB 2 tablet
|
Quote:
I use iBooks and Bluefire Reader to test ebooks on my iPad, and they both seem to have wider 'pages' with more words per line for similar font sizes than by Sony and Kobo do. |
|
05-24-2017, 01:39 AM | #14 | |
Curmudgeon
Posts: 629
Karma: 1623086
Join Date: Jan 2012
Device: iPad, iPhone, Nook Simple Touch
|
Quote:
On the flip side, page-break-after: is almost guaranteed to be completely ignored unless the value is always. There may be certain situations where it works with avoid, but you're probably just wasting bytes. |
|
05-24-2017, 01:57 AM | #15 |
Wizard
Posts: 3,821
Karma: 19162882
Join Date: Nov 2012
Location: Te Riu-a-Māui
Device: Kobo Glo
|
In my experience page-break-after: avoid; has always worked perfectly in the Kobo (Adobe RMSDK 10 based) ePub reader.
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
page-break-inside on Google Play Books | Oxford-eBooks | ePub | 10 | 07-01-2015 12:17 AM |
Keeping text together (block vs. page-break-inside:avoid) | Psymon | ePub | 2 | 10-12-2014 09:56 AM |
iPad iBooks: page-break-after/inside/before NOT working? | philx | Apple Devices | 7 | 01-27-2013 12:42 AM |
Page-Break-Inside: Avoid - Solution or Hack? | sab1234 | Kindle Formats | 3 | 01-17-2013 04:10 PM |
Page-break-inside:avoid and mobi | AlexBell | Kindle Formats | 3 | 06-01-2011 06:03 AM |