06-30-2016, 07:31 AM | #1 |
Age improves with wine.
Posts: 558
Karma: 95229
Join Date: Nov 2014
Device: Kindle Oasis, Kobo Libra II
|
CSS compliance in AZW3 books?
I've noticed that my Kindle ignores "page-break-after:avoid" on subheadings, which is pretty annoying; I've also tried to persuade it to do automatic dictionary based hyphenation by putting lang="en" in the <html> tag and then applying various CSS styles to <body>: hyphens, -webkit-hyphens, -moz-hyphens and -ms-hyphens, none of which seem to work.
Can anyone tell me if there's a (probably Kindle-specific) way to do these things? And, does anyone have a list of workarounds for any other CSS things that don't work in AZW3 files? TIA! |
06-30-2016, 07:54 AM | #2 |
eBook Enthusiast
Posts: 85,544
Karma: 93383043
Join Date: Nov 2006
Location: UK
Device: Kindle Oasis 2, iPad Pro 10.5", iPhone 6
|
Moved to the "Kindle Formats" forum, where such questions belong.
|
Advert | |
|
06-30-2016, 07:54 AM | #3 | |
Going Viral
Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
|
Quote:
https://www.mobileread.com/forums/forumdisplay.php?f=168 which is the Kindle formats forum. |
|
06-30-2016, 09:11 AM | #4 | |
Grand Sorcerer
Posts: 6,470
Karma: 84000001
Join Date: Nov 2011
Location: Tampa Bay, Florida
Device: Kindles
|
Quote:
The Amazon Kindle Publishing Guidelines provides some (incomplete) information about what does and doesn't work in Kindle books. |
|
06-30-2016, 10:26 AM | #5 | |
Age improves with wine.
Posts: 558
Karma: 95229
Join Date: Nov 2014
Device: Kindle Oasis, Kobo Libra II
|
Quote:
The Kindle Publishing Guidelines are pretty useless -- nothing about levels of CSS support, just some short platitudes about anchor placement, supported types of space, and don't forget to use entities for <, > and &. Certainly no clue as to why page-break-after:avoid is ignored. |
|
Advert | |
|
07-07-2016, 09:07 PM | #6 | |
Bookmaker & Cat Slave
Posts: 11,447
Karma: 157030631
Join Date: Apr 2010
Location: Phoenix, AZ
Device: K2, iPad, KFire, PPW, Voyage, NookColor. 2 Droid, Oasis, Boox Note2
|
Quote:
They have 3 different sets of "guidelines" out. The ones on the web; the downloadable "simplified guidelines" and the actual Publisher's Guidelines. Google for it, and download the PDF. It absolutely is clear on what CSS is supported and which isn't. We use page-break-after all the time. Something's not right in your file. Hitch |
|
07-08-2016, 12:48 AM | #7 | |
Bookaholic
Posts: 14,391
Karma: 54969924
Join Date: Oct 2007
Location: Minnesota
Device: iPad Mini 4, AuraHD, iPhone XR +
|
Quote:
https://kindlegen.s3.amazonaws.com/A...Guidelines.pdf |
|
07-08-2016, 04:57 AM | #8 | |
Age improves with wine.
Posts: 558
Karma: 95229
Join Date: Nov 2014
Device: Kindle Oasis, Kobo Libra II
|
Quote:
https://kindlegen.s3.amazonaws.com/A...Guidelines.pdf If that's not the one you mean, can you post me a link please? In this one, Section 6 is a single page of dos and don'ts; on p.30 it says "Do not insert blank lines of text to create page breaks. Use the CSS page-break-before and page-break-after attributes." It doesn't say anything about avoiding page breaks. Section 16.2 (p.81 onwards) is a list of supported CSS attributes; page-break-after and page-break-before are not listed. I have <h3> specified as "page-break-after: avoid", but despite this <h3> headings sometimes appear as the last line on a page. Changing "avoid" to "always" appears to work. So, further advice is welcome. |
|
07-08-2016, 05:08 AM | #9 | |
The Grand Mouse 高貴的老鼠
Posts: 71,406
Karma: 305065800
Join Date: Jul 2007
Location: Norfolk, England
Device: Kindle Voyage
|
Quote:
"page-break-after: avoid" is NOT the equivalent of the "keep-with-next" attribute in page layout software. It's advice, not a requirement. |
|
07-08-2016, 07:12 AM | #10 |
eBook Enthusiast
Posts: 85,544
Karma: 93383043
Join Date: Nov 2006
Location: UK
Device: Kindle Oasis 2, iPad Pro 10.5", iPhone 6
|
Yes. "Always" is a command; "avoid" is merely a polite suggestion.
|
07-09-2016, 06:29 AM | #11 | |
mostly an observer
Posts: 1,515
Karma: 987654
Join Date: Dec 2012
Device: Kindle
|
Quote:
|
|
07-09-2016, 04:59 PM | #12 |
Bookmaker & Cat Slave
Posts: 11,447
Karma: 157030631
Join Date: Apr 2010
Location: Phoenix, AZ
Device: K2, iPad, KFire, PPW, Voyage, NookColor. 2 Droid, Oasis, Boox Note2
|
Sorry, my bad:
somehow, I got my head on backwards, and thought we were discussing inserting the page-break-before, yadda. Not the "avoid." Avoid pretty much doesn't work, ANY-PLACE. Yeah, yeah, in ePUB3, on an iPad, you can kinda rely on it. That's it, however. Maybe ePUB3 in Readium/Azardi. After that, you might as well just light joss sticks and pray a lot. Hitch |
07-09-2016, 11:38 PM | #13 | |
Curmudgeon
Posts: 629
Karma: 1623086
Join Date: Jan 2012
Device: iPad, iPhone, Nook Simple Touch
|
Quote:
AFAIK, even iBooks ignores page-break-after/before:avoid unless they've fixed it in the last year or so and failed to close the canonical bug. With that said, if you can wrap the two pieces of content in a div and mark that with page-break-inside: avoid, you should usually prevent the break without forcing a break before the first item, provided that:
But as mentioned, nothing is guaranteed, and if the renderer cannot make it work, it is allowed to ignore it. Unfortunately, #3 above makes it unusable for what many folks want to use it for—keeping captions with images—but if you're not trying to do this with an auto-sized image, it ought to work for you. Let us know if it doesn't, because that would be an interesting breakage by Amazon (or an edge case, and I'd have to see your actual code to know which). Last edited by dgatwood; 07-09-2016 at 11:43 PM. |
|
07-10-2016, 01:13 PM | #14 | |||
Bookmaker & Cat Slave
Posts: 11,447
Karma: 157030631
Join Date: Apr 2010
Location: Phoenix, AZ
Device: K2, iPad, KFire, PPW, Voyage, NookColor. 2 Droid, Oasis, Boox Note2
|
Agreed. I'm generalizing.
Quote:
And yes, #3 is usually the killer, because 99% of the time, the client (bookmaker, etc.) is usually trying to slap a caption with an image, as you've mentioned. The image is usually filling the screen, in width, at least, so...that's DOA. Quote:
Quote:
Hitch |
|||
07-11-2016, 07:31 AM | #15 | |
Age improves with wine.
Posts: 558
Karma: 95229
Join Date: Nov 2014
Device: Kindle Oasis, Kobo Libra II
|
Quote:
All the same, it seems odd that "avoid" is basically ALWAYS ignored of page-break-after. I would have thought "keep with next (where feasible)" would be a sensible interpretation; oh well. Yes, I know it's only advice, but even my mother's advice wasn't ignored that consistently... Thanks! Last edited by Phssthpok; 07-11-2016 at 07:36 AM. |
|
Tags |
azw3, css |
Thread Tools | Search this Thread |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
epub to azw3 conversion and Extra CSS | Section8 | Conversion | 8 | 02-06-2015 11:55 PM |
Epub to AZW3: css formatting not showing | topquark | Conversion | 1 | 03-20-2013 12:21 AM |
Cannot open or convert certain AZW3 books | bshar489 | Calibre | 2 | 03-18-2013 11:47 AM |
Development GPL Compliance | jcase | enTourage Archive | 85 | 01-03-2011 05:58 PM |
pdflrf: Possible non-compliance of GPL terms | ashkulz | Feedback | 2 | 09-05-2008 12:05 AM |