09-28-2018, 04:08 AM | #1 |
Guru
Posts: 668
Karma: 929286
Join Date: Apr 2014
Device: PW-3, iPad, Android phone
|
text-align: initial; -- ??
I was restyling an epub3 file and wanted to change the text alignment.
So just did p{ text-align:justify;} Viewing the epub, it's justified. Converted to AZW3 using Kindlegen, the text is left justified on my PW3. Cannot be changed. Hair-pulling ensues. I used the Calibre viewer on the AZW3 and its inspector shows me that text-align: initial; is having an effect. I find that at the end of the css, in media queries: Code:
@media amzn-kf8 { body { margin-left: 0.00em; margin-right: 0.00em; text-indent: 0.00em; } p { /*new requirements for device adjustable line spacing*/ text-align: initial; } But why is it here? The comment states it's necessary for linespacing, but I can adjust linespacing in Kindle regardless on any azw I have. What does "initial" mean anyway? Where is the "initial justification" defined? Is it different for each device, reader? Is this code actually useful in some situation? Seems to cause more trouble than it could solve. Last edited by AlanHK; 09-28-2018 at 04:10 AM. |
09-28-2018, 08:31 AM | #2 |
Grand Sorcerer
Posts: 6,496
Karma: 84420419
Join Date: Nov 2011
Location: Tampa Bay, Florida
Device: Kindles
|
In CSS "initial" is equivalent to the default value for the property, which is "left" for text-align (for left-to-right text).
Forcing left aligned text seems like a bad idea and the comment in the CSS makes no sense to me. |
09-28-2018, 10:27 AM | #3 | |
Guru
Posts: 668
Karma: 929286
Join Date: Apr 2014
Device: PW-3, iPad, Android phone
|
Quote:
Seems more like someone misread something. |
|
10-02-2018, 11:42 AM | #4 | ||||
Bookmaker & Cat Slave
Posts: 11,462
Karma: 158448243
Join Date: Apr 2010
Location: Phoenix, AZ
Device: K2, iPad, KFire, PPW, Voyage, NookColor. 2 Droid, Oasis, Boox Note2
|
Quote:
Quote:
A comment about software/typography/MS: Spoiler:
Quote:
Quote:
What's bizarre, though, @jhowell, is, isn't initial supposed to be overridable? Designed to be? Not act as the override itself? Or am I wrong about that? Hitch |
||||
10-02-2018, 04:01 PM | #5 | |
Grand Sorcerer
Posts: 6,496
Karma: 84420419
Join Date: Nov 2011
Location: Tampa Bay, Florida
Device: Kindles
|
Quote:
a nameless value that acts as 'left' if 'direction' is 'ltr', 'right' if 'direction' is 'rtl' So for left-to-right text a CSS property declaration of "text-align: initial" is equivalent to "text-align: left". There is nothing in the specification about it being treated differently in terms of being overridable. For books in KFX format (Enhanced Typesetting), Amazon allows the user to override the alignment of justified text to be left-aligned instead. That is independent of the CSS used AFAIK. Last edited by jhowell; 10-02-2018 at 04:45 PM. Reason: typo |
|
10-02-2018, 11:26 PM | #6 | |||||||
Guru
Posts: 668
Karma: 929286
Join Date: Apr 2014
Device: PW-3, iPad, Android phone
|
Quote:
To be pedantic, you are actually being pedantic. I can be just as irritatingly nitpicking if I put my mind to it. But all it does is piss people off and start feuds. Quote:
Of course, I could set it in CSS too. However, "Alignment" is greyed out. "This book does not support Left Alignment and other enhanced typography options." So I assume that's only for KFX, and I'm making KF8. Quote:
Quote:
What I asked was not in general, but where does the "initial" value in an epub or mobi come from? Is it in a standard somewhere? Quote:
Quote:
Quote:
Last edited by AlanHK; 10-02-2018 at 11:36 PM. |
|||||||
10-03-2018, 11:18 AM | #7 | ||||||
Bookmaker & Cat Slave
Posts: 11,462
Karma: 158448243
Join Date: Apr 2010
Location: Phoenix, AZ
Device: K2, iPad, KFire, PPW, Voyage, NookColor. 2 Droid, Oasis, Boox Note2
|
Quote:
To wit, "The reason for this is that any styling on body text in the HTML will override the user’s preferred default reading settings. Users report such behavior as a poor reading experience." They used to expressly tell you not to do it, but now, they simply say "The body text in a reflowable Kindle book (fiction and non-fiction) must be all defaults. Amazon encourages content creators to use creative styles for headings, special paragraphs, footnotes, tables of contents, etc., but not for body text." [Ital emphasis added] This goes back to the very earliest Publishing Guidelines. Quote:
Quote:
And that's KF8, not KFX. I can change both the alignment, and the line-spacing (line-heights, effectively) on my K10, on any mobi we've made, and most of the books I buy from Amazon--unless the producer of that book has set the body text defaults in a way that precludes that. Which means, line-height settings other than the default, or alignment settings. If you make a book with justification set, for example, you cannot change the alignment, on my K10. We've tested that. I would fully expect a raft of KQNS, headed all our ways, as book producers who used to set body alignments to justified, from older books, as this functionality becomes more widespread in the Kindleverse. I mean, hell, we used to set it, too, in the earliest days of my own biz, and yes--I fully expect to see those suckers coming back to us, for fixing. I expect this because I know factually that Amazon has sent KQN's (Kindle Quality Notices) to publishers who've set the body alignment--both for align-left, and justified. We had a client that insisted on left-alignment, for her book, even though I told her that Amazon would give her fits, eventually, and sure as crap, not only did she get a KQN, but they removed the book from sale until it was fixed. Quote:
Amazon's made it clear that they've been moving in this direction with their further instructions not to mess with the line-heights (in this case, I am talking about line-height, which of course, does affect spacing, one way or the other) for the last few years. Just like fonts and alignment, presumably, if you override body line-heights/line-spacing, the same thing would happen--the end user wouldn't be able to set it to their own preference. We've all played with and coded line-heights for various elements--say, pullquotes, text-boxes, etc. Where you can get in trouble is with the body text--in which case, Amazon overrides it anyway at the KDP intake. (I recently had this discussion with a client, who was irate that his "last bookmaker" had done what he'd asked, and made his line-heights effectively 2x line spacing. I had to prove to him that what his previous bookmaker had handed to him was NOT what he had, once he'd uploaded it, when Amazon switched it back to the ubiquitous 1.2em line-heights.) Quote:
Quote:
Hitch |
||||||
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Is text-align-last not supported? | fxp33 | Editor | 2 | 01-28-2018 02:27 PM |
Text still full justifying on iPad, even through style says align left | SamL | ePub | 13 | 04-20-2017 10:24 PM |
text-align:lol; | odedta | ePub | 6 | 06-16-2014 09:40 AM |
Center align text in epub | virtual_ink | ePub | 23 | 08-31-2011 06:27 AM |
I can not align the text...help please! XD | derfel_spain | ePub | 17 | 12-18-2010 09:45 AM |