View Single Post
Old 06-18-2023, 10:05 PM   #1
nabsltd
Fanatic
nabsltd ought to be getting tired of karma fortunes by now.nabsltd ought to be getting tired of karma fortunes by now.nabsltd ought to be getting tired of karma fortunes by now.nabsltd ought to be getting tired of karma fortunes by now.nabsltd ought to be getting tired of karma fortunes by now.nabsltd ought to be getting tired of karma fortunes by now.nabsltd ought to be getting tired of karma fortunes by now.nabsltd ought to be getting tired of karma fortunes by now.nabsltd ought to be getting tired of karma fortunes by now.nabsltd ought to be getting tired of karma fortunes by now.nabsltd ought to be getting tired of karma fortunes by now.
 
Posts: 521
Karma: 8500000
Join Date: Aug 2013
Location: Hamden, CT
Device: Kindle Paperwhite (11th gen), Scribe, Kindle 4 Touch
Odd margin error on Kindle

Attached is an epub source that shows some strange issues with margins when converted to any modern format that a Kindle can use (KF8 or KFX).

There are two pages in the epub...the first renders correctly on every reader other than a Kindle that I can test. The second page gives close to the results I want on a Kindle (including Kindle Previewer 3), but not on other readers.

The CSS class heading-chapter is used to create a box that is at the right-hand side of the page. Then, heading-chapter-header and heading-chapter-number center that info in the box. Below that, the CSS class heading-chapter-image moves in the left and right margins from heading-chapter and then para-centerFirst is used to center an image that uses image-fitwidth to get the image centered and filling the width, so that the image will be generally narrower than the text (except for very small base font size choices from the reader).

The problem is that the image is not centered on the text when rendered by the Kindle. I need to adjust the margins from being 30% on each side to being 25% and 10% (left and right respectively) in order to get close to centered.

This seems like really simple CSS to me, and I'd like a version that works on all readers.

Any ideas?
Attached Thumbnails
Click image for larger version

Name:	KindleCSSCentering.png
Views:	224
Size:	44.0 KB
ID:	202118  
Attached Files
File Type: epub ConvertTest - (testing).epub (5.4 KB, 219 views)
nabsltd is offline   Reply With Quote