View Single Post
Old 07-10-2019, 02:04 PM   #94
lumpynose
Wizard
lumpynose ought to be getting tired of karma fortunes by now.lumpynose ought to be getting tired of karma fortunes by now.lumpynose ought to be getting tired of karma fortunes by now.lumpynose ought to be getting tired of karma fortunes by now.lumpynose ought to be getting tired of karma fortunes by now.lumpynose ought to be getting tired of karma fortunes by now.lumpynose ought to be getting tired of karma fortunes by now.lumpynose ought to be getting tired of karma fortunes by now.lumpynose ought to be getting tired of karma fortunes by now.lumpynose ought to be getting tired of karma fortunes by now.lumpynose ought to be getting tired of karma fortunes by now.
 
Posts: 1,086
Karma: 6719822
Join Date: Jul 2012
Device: Palm Pilot M105
Quote:
Originally Posted by jackie_w View Post
The problem you're seeing is entirely due to the differences in the default override CSS used by the two different Kobo reading apps used for kepub and standard epub.

For text alignment, the Adobe app, used for standard epub, uses
Code:
body {text-align: %1 !important;}
as it's override CSS, where %1 is the value you choose in the Kobo's [Aa] font menu (if it's not set to 'Off').

On the other hand, for the kepub reading app, the default override CSS used is
Code:
div, p { text-align: %1 !important;}
This is why setting the alignment to anything other than 'Off' changes your kepub centred styles for <div>s and <p>s to left/justify depending on which alignment you selected.

You have 2 choices to change this inconvenient behaviour:
  • set the Justification button to 'Off' and leave it there. You will then be reliant on each of your epubs/kepubs containing your text-align value(s) of choice.
  • use a kobo patch to change the override CSS for kepubs to match that for standard epubs. I don't remember whether you're a user of the kobopatch system but if you are the one you need to enable is called 'Un-Force user text-align in div,p tags in KePubs'
I forgot to respond about another idea I had about this. I was thinking that what's wanted is to only override the justified/left align for top level paragraphs; e.g.,
Code:
body > p, section > p { text-align: %1 !important; }
Although I'm not sure if that would match all top level paragraphs; what a top level paragraph is might be different for various scenarios. The other alternative, which I suspect CSS may not have is to only change text-align when it's set to justify or left. But even that would need tweaking if it's displaying a right-to-left language.

Last edited by lumpynose; 07-10-2019 at 02:06 PM.
lumpynose is offline   Reply With Quote