Quote:
Originally Posted by Turtle91
For horizontal centering, the techniques are the same as any other text. You need to make sure you have nothing else adjusting the letters to the right… such as text-indent or maybe a margin/padding.
[...]
Another culprit to check is if the Kobo Libra is adding a text-indent because of user settings in the Kobo itself??
|
I can't figure out what my Kobo reader is doing in the background. You can see below in my full code that I don't do anything other than what you suggest.
Quote:
Originally Posted by theducks
Centering works fin on a Libra2.
|
In general it does, but in this particular case you can see that it doesn't.
In summary, everything seems to work in Sigil's viewer and in Calibre's epub viewer. The problem is that on the Kobo Libra 2 this vertical alignment does not work at all in epub format (the text is stuck to the top edge of the screen), although it does work partially in kepub format: the vertical alignment is correct, but the horizontal alignment is somewhat shifted to the right.
This is the complete code I used. In Sigil it looks fine, but not in Kobo Libra 2 (converted to kepub with Calibre):
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
<style>
div.v-ctr { display:table; height:100%; width:100%; position:fixed;
padding:0; margin:0; text-indent:0 !important; }
div.v-ctr div { display:table-cell; vertical-align:middle;
padding:0; margin:0; text-indent:0 !important; }
.ctr { text-align:center !important; }
</style>
</head>
<body>
<div class="v-ctr">
<div>
<p>VERTICALLY CENTERED</p>
<p class="ctr">HORIZONTALLY CENTERED</p>
</div>
</div>
</body>
</html>
Notice in the attached screenshot that the “VERTICALLY CENTERED” paragraph does not start at zero.