Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Readers > Android Devices

Notices

Reply
 
Thread Tools Search this Thread
Old 08-20-2022, 05:03 PM   #1
bookman156
Addict
bookman156 ought to be getting tired of karma fortunes by now.bookman156 ought to be getting tired of karma fortunes by now.bookman156 ought to be getting tired of karma fortunes by now.bookman156 ought to be getting tired of karma fortunes by now.bookman156 ought to be getting tired of karma fortunes by now.bookman156 ought to be getting tired of karma fortunes by now.bookman156 ought to be getting tired of karma fortunes by now.bookman156 ought to be getting tired of karma fortunes by now.bookman156 ought to be getting tired of karma fortunes by now.bookman156 ought to be getting tired of karma fortunes by now.bookman156 ought to be getting tired of karma fortunes by now.
 
Posts: 368
Karma: 1000000
Join Date: Mar 2016
Device: none
Lithium reader, can't get it to centre headings

I really like Lithium reader, it seems to render most CSS and embedded fonts okay, and it works nicely, but I just can't get it to respect 'text-align: center;' on a h1 tag. Looks like you set all the text to either justified or unjustified and that overrides everything.

Am I doing something wrong? Has anyone been able to centre headings on Lithium?
bookman156 is offline   Reply With Quote
Old 08-20-2022, 05:04 PM   #2
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
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
We'll need to see samples of the HTML/CSS code.
JSWolf is offline   Reply With Quote
Advert
Old 08-20-2022, 06:05 PM   #3
bookman156
Addict
bookman156 ought to be getting tired of karma fortunes by now.bookman156 ought to be getting tired of karma fortunes by now.bookman156 ought to be getting tired of karma fortunes by now.bookman156 ought to be getting tired of karma fortunes by now.bookman156 ought to be getting tired of karma fortunes by now.bookman156 ought to be getting tired of karma fortunes by now.bookman156 ought to be getting tired of karma fortunes by now.bookman156 ought to be getting tired of karma fortunes by now.bookman156 ought to be getting tired of karma fortunes by now.bookman156 ought to be getting tired of karma fortunes by now.bookman156 ought to be getting tired of karma fortunes by now.
 
Posts: 368
Karma: 1000000
Join Date: Mar 2016
Device: none
Pretty standard stuff:

Code:
h1 {
font-size: 2em;
line-height: 1.5em;
font-weight: bold;
text-align: center;
}
It's more whether Lithium reader just doesn't centre text. Or whether anyone else has managed it.
bookman156 is offline   Reply With Quote
Old 08-21-2022, 04:47 AM   #4
Quoth
the rook, bossing Never.
Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.
 
Quoth's Avatar
 
Posts: 11,166
Karma: 85874891
Join Date: Jun 2017
Location: Ireland
Device: All 4 Kinds: epub eink, Kindle, android eink, NxtPaper11
Could be some other CSS messing up.
I just checked one of our books on Lithium, which I use because it seems to respect CSS etc. Also works well with Calibre and/or SD Card.

All the centred (center) headings are OK.

As an aside, I remove line-height from CSS on any converted ebooks.
Quoth is offline   Reply With Quote
Old 08-21-2022, 07:28 AM   #5
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
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:
Originally Posted by bookman156 View Post
Pretty standard stuff:

Code:
h1 {
font-size: 2em;
line-height: 1.5em;
font-weight: bold;
text-align: center;
}
It's more whether Lithium reader just doesn't centre text. Or whether anyone else has managed it.
You left out the HTML code. And is there any more CSS that's relevant?
JSWolf is offline   Reply With Quote
Advert
Old 08-21-2022, 09:40 AM   #6
jackie_w
Grand Sorcerer
jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.
 
Posts: 6,212
Karma: 16534894
Join Date: Sep 2009
Location: UK
Device: Kobo: KA1, ClaraHD, Forma, Libra2, Clara2E. PocketBook: TouchHD3
Every epub reading app (on eink or Android) I've ever used which offers some kind of option to choose between left align (ragged right) or full-justified uses a broadly similar method to enforce the user's choice.

It's always a small piece of override CSS which looks something like one of the following (in descending order of "aggressiveness"):
  1. * {text-align:left !important;} (or * {text-align:justify !important;}
  2. div, p {text-align:left !important;} (or div, p {text-align:justify !important;}
  3. body {text-align:left !important;} (or body {text-align:justify !important;}

The choice of which HTML tags to apply the override to is entirely up to the app developer. Whatever level they choose they will end up delighting some users and upsetting others. Some apps (e.g. KOReader) may give the user a limited choice of how aggressive to be.

If Lithium has opted for the most aggressive override, * {text-align:left !important;}, then there is nothing you can do to prevent your <h1> tagged centred text from being forced to text-align:left/justify if you press the left/justify option buttons. The only way to keep them centred is to leave the 'Text align' option set to 'Original'.
jackie_w is offline   Reply With Quote
Old 08-21-2022, 10:20 AM   #7
bookman156
Addict
bookman156 ought to be getting tired of karma fortunes by now.bookman156 ought to be getting tired of karma fortunes by now.bookman156 ought to be getting tired of karma fortunes by now.bookman156 ought to be getting tired of karma fortunes by now.bookman156 ought to be getting tired of karma fortunes by now.bookman156 ought to be getting tired of karma fortunes by now.bookman156 ought to be getting tired of karma fortunes by now.bookman156 ought to be getting tired of karma fortunes by now.bookman156 ought to be getting tired of karma fortunes by now.bookman156 ought to be getting tired of karma fortunes by now.bookman156 ought to be getting tired of karma fortunes by now.
 
Posts: 368
Karma: 1000000
Join Date: Mar 2016
Device: none
Quote:
If Lithium has opted for the most aggressive override, * {text-align:left !important;}, then there is nothing you can do to prevent your <h1> tagged centred text from being forced to text-align:left/justify if you press the left/justify option buttons. The only way to keep them centred is to leave the 'Text align' option set to 'Original'.
It doesn't look to me that Lithium has any way of setting text align to original, it's either justified or unjustified, doesn't seem to be a way of not having one of them chosen, unless I'm missing something staring me in the face.

Quote:
I just checked one of our books on Lithium, which I use because it seems to respect CSS etc. Also works well with Calibre and/or SD Card.

All the centred (center) headings are OK.
Well that's interesting. I'm going to have to have another look at this.
bookman156 is offline   Reply With Quote
Old 08-21-2022, 10:22 AM   #8
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
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
@bookman156 post the entire CSS (in a code block) and the HTML code from the start of the HTML file to the start of the first paragrah (in another code block) so we can have a look and see what's going on.
JSWolf is offline   Reply With Quote
Old 08-21-2022, 10:28 AM   #9
bookman156
Addict
bookman156 ought to be getting tired of karma fortunes by now.bookman156 ought to be getting tired of karma fortunes by now.bookman156 ought to be getting tired of karma fortunes by now.bookman156 ought to be getting tired of karma fortunes by now.bookman156 ought to be getting tired of karma fortunes by now.bookman156 ought to be getting tired of karma fortunes by now.bookman156 ought to be getting tired of karma fortunes by now.bookman156 ought to be getting tired of karma fortunes by now.bookman156 ought to be getting tired of karma fortunes by now.bookman156 ought to be getting tired of karma fortunes by now.bookman156 ought to be getting tired of karma fortunes by now.
 
Posts: 368
Karma: 1000000
Join Date: Mar 2016
Device: none
Quote:
You left out the HTML code. And is there any more CSS that's relevant?
I posted what I thought was relevant, but here's the whole of the CSS excluding the embedded font in case I'm missing something. HTML is just standard stuff, h1 wrapping a heading:

Code:
body {
font-family: "Dante MT Std", serif;
font-weight: normal;
color: #000000;
margin: 0.5em;
widows: 1;
orphans: 1;
}

h1 {
font-size: 2em;
line-height: 1.5em;
font-weight: bold;
text-align: center;
}

p {
	font-size: 1em;
	line-height: 1.4em;
	text-indent: 1em;
	text-align: left;
	margin: 0;
}

p.space {
    margin-top: 1.2em;
}

p.first {
    text-indent: 0;
    margin-top: 3em;
}

p.noindent {
	text-indent: 0;
}

p.noindentspace {
    text-indent: 0;
    margin-top: 1.2em;
} /* a space, but still part of previous portion of text */

p.noindentspacebelow {
    text-indent: 0;
    margin-bottom: 1.7em;
}  

p.byline {
	font-size: 1.4em;
  	line-height: 1.5em;
  	margin-top: -0.6em;
	font-style: italic;
	text-indent: 0;
	text-align: center;
}

p.epigraph {
    font-size: 1.3em;
    line-height: 1.4em;
    margin-top: 1em;
    text-indent: 0;
    text-align: center;
  }

em {
	font-style: italic;
}

hr.transition {
    margin: 1.5em 40% 1.55em 40%;
    border: 0;
    border-bottom: 1px solid #CCC; 
  }
bookman156 is offline   Reply With Quote
Old 08-21-2022, 10:31 AM   #10
bookman156
Addict
bookman156 ought to be getting tired of karma fortunes by now.bookman156 ought to be getting tired of karma fortunes by now.bookman156 ought to be getting tired of karma fortunes by now.bookman156 ought to be getting tired of karma fortunes by now.bookman156 ought to be getting tired of karma fortunes by now.bookman156 ought to be getting tired of karma fortunes by now.bookman156 ought to be getting tired of karma fortunes by now.bookman156 ought to be getting tired of karma fortunes by now.bookman156 ought to be getting tired of karma fortunes by now.bookman156 ought to be getting tired of karma fortunes by now.bookman156 ought to be getting tired of karma fortunes by now.
 
Posts: 368
Karma: 1000000
Join Date: Mar 2016
Device: none
Here's the start of the HTML, from Sigil:

Code:
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml" xmlns:epub="http://www.idpf.org/2007/ops">
<head>
  <title>Blah blah</title>
  	<link href="../Styles/main.css" rel="stylesheet" type="text/css" />
</head>

<body>

<h1>Blah blah</h1>

<p class="byline">Blah blah</p>

<p class="epigraph">Blah blah</p>

<p class="first">Blah blah.</p>
bookman156 is offline   Reply With Quote
Old 08-21-2022, 10:51 AM   #11
bookman156
Addict
bookman156 ought to be getting tired of karma fortunes by now.bookman156 ought to be getting tired of karma fortunes by now.bookman156 ought to be getting tired of karma fortunes by now.bookman156 ought to be getting tired of karma fortunes by now.bookman156 ought to be getting tired of karma fortunes by now.bookman156 ought to be getting tired of karma fortunes by now.bookman156 ought to be getting tired of karma fortunes by now.bookman156 ought to be getting tired of karma fortunes by now.bookman156 ought to be getting tired of karma fortunes by now.bookman156 ought to be getting tired of karma fortunes by now.bookman156 ought to be getting tired of karma fortunes by now.
 
Posts: 368
Karma: 1000000
Join Date: Mar 2016
Device: none
@Quoth

Just looked at your sample of Under the Stone of Destiny in Lithium and your centred headings are left aligned. That's with unjustified button in Lithium. With justified button they're still not centred, but an attempt at justification, ie massive spaces.

I don't see how to look at an epub without one of those two buttons selected.

I'm using Lithium 0.24.1

Last edited by bookman156; 08-21-2022 at 10:59 AM.
bookman156 is offline   Reply With Quote
Old 08-21-2022, 11:01 AM   #12
Quoth
the rook, bossing Never.
Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.
 
Quoth's Avatar
 
Posts: 11,166
Karma: 85874891
Join Date: Jun 2017
Location: Ireland
Device: All 4 Kinds: epub eink, Kindle, android eink, NxtPaper11
I use Lithium on Android because it doesn't overide any CSS.
It displays the same as epub on Kobo or Sony PRS-350
Quoth is offline   Reply With Quote
Old 08-21-2022, 11:06 AM   #13
Quoth
the rook, bossing Never.
Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.
 
Quoth's Avatar
 
Posts: 11,166
Karma: 85874891
Join Date: Jun 2017
Location: Ireland
Device: All 4 Kinds: epub eink, Kindle, android eink, NxtPaper11
The sample I just looked at has this CSS for chapter headings.
It's fine on Lithium on Android 8 and Android 5!
Same as full version.
The Sample merely has chapter contents snipped on later chapters.
.block_12 {
display: block;
font-family: "Gaelic", serif;
font-size: 1.41667em;
margin-bottom: 6pt;
margin-left: 0;
margin-right: 0;
margin-top: 22pt;
padding-bottom: 0;
padding-left: 0;
padding-right: 0;
padding-top: 0;
text-align: center
}

5" phone and 10" tablet.

Under Lithium A<cog> option Text Align is "Original"
Ver 0.24.1
Quoth is offline   Reply With Quote
Old 08-21-2022, 11:08 AM   #14
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
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:
Originally Posted by bookman156 View Post
@Quoth

Just looked at your sample of Under the Stone of Destiny in Lithium and your centred headings are left aligned. That's with unjustified button in Lithium. With justified button they're still not centred, but an attempt at justification, ie massive spaces.

I don't see how to look at an epub without one of those two buttons selected.

I'm using Lithium 0.24.1
Is that the latest version of Lithium? I don't see a version number on Google Play.
JSWolf is offline   Reply With Quote
Old 08-21-2022, 11:10 AM   #15
Quoth
the rook, bossing Never.
Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.
 
Quoth's Avatar
 
Posts: 11,166
Karma: 85874891
Join Date: Jun 2017
Location: Ireland
Device: All 4 Kinds: epub eink, Kindle, android eink, NxtPaper11
Actually for first item on a page "padding-top" is better than "margin-top".
Quoth is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Lost the Kobo help centre Mohan-V-Allied Kobo Reader 7 08-23-2019 07:46 AM
How to convert ''Headings'' to ''HEADINGS''? chaot Workshop 13 03-16-2017 03:32 PM
iPad What is the normal temperature operating range for iPad/lithium battery Alberich Apple Devices 5 12-14-2012 04:48 PM
UK's Printed Electronics Technology Centre (PETEC) and the Flexible Display Centre ( Dulin's Books News 0 02-18-2010 02:30 PM
Lithium-Ion battery care Wetdogeared Sony Reader 16 12-02-2008 08:52 PM


All times are GMT -4. The time now is 07:45 PM.


MobileRead.com is a privately owned, operated and funded community.