View Single Post
Old 05-12-2024, 10:24 AM   #8
Turtle91
A Hairy Wizard
Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.
 
Turtle91's Avatar
 
Posts: 3,430
Karma: 20456789
Join Date: Dec 2012
Location: Charleston, SC today
Device: iPhone 15/11/X/6/iPad 1,2,Air & Air Pro/Surface Pro/Kindle PW & Fire
Quote:
Originally Posted by repilo View Post
Unfortunately, it doesn't work well on my Kobo Libra 2. The vertical centering is correct, but it doesn't do the horizontal centering well: the paragraph is centered but a bit shifted to the right.
The horizontal alignment has nothing to do with the technique provided. As you said, the vertical centering works fine.

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.

That is why I included:
margin:0;
padding:0;
text-indent:0;

Another, less common, culprit is letter-spacing; that places extra spacing to the left of each letter, including the first.

Definitely do NOT try to use this in the same html file as other, non-centered, text. It will float over the top of the other text. Make sure it is in its own html file.

Edit:
Sorry I didn't show the CSS in the image attachment above. Here it is. Also... Make sure you are not applying other css to the file...either check with Sigil's built-in css inspector in the Preview Window to see if something else is being applied to your page
- OR -
just don't link a css sheet and place the css in the <style> section of the header...as shown in attached image.

Another culprit to check is if the Kobo Libra is adding a text-indent because of user settings in the Kobo itself?? If this is the case, you may want to add !important after the text-indent. Not sure it will work if Kobo is forcing it's own settings over the css???

text-indent:0 !important
Attached Thumbnails
Click image for larger version

Name:	Screenshot 2024-05-12 104803.png
Views:	399
Size:	179.9 KB
ID:	208220  

Last edited by Turtle91; 05-12-2024 at 11:58 AM.
Turtle91 is offline   Reply With Quote