View Single Post
Old 02-03-2022, 08:02 PM   #1
SigilBear
Banned
SigilBear ought to be getting tired of karma fortunes by now.SigilBear ought to be getting tired of karma fortunes by now.SigilBear ought to be getting tired of karma fortunes by now.SigilBear ought to be getting tired of karma fortunes by now.SigilBear ought to be getting tired of karma fortunes by now.SigilBear ought to be getting tired of karma fortunes by now.SigilBear ought to be getting tired of karma fortunes by now.SigilBear ought to be getting tired of karma fortunes by now.SigilBear ought to be getting tired of karma fortunes by now.SigilBear ought to be getting tired of karma fortunes by now.SigilBear ought to be getting tired of karma fortunes by now.
 
Posts: 244
Karma: 2112680
Join Date: Jan 2017
Device: iBooks
Problems with Image CSS

I just published a couple epubs to Amazon, Barnes & Noble and Kobo. They look OK except for the images. In most cases, the images display on separate pages, instead of within the text.

Images that are supposed to be tiny icons may span an entire page.

The problem is worst in Kobo. I e-mailed them, but never got a reply.

You can see an example if you click "Preview" @ here. The image at the top of the Table of Contents page is supposed to be a tiny icon.

This is my CSS:

/* Set width of div enclosing image. */
.x--w50 { width: 50%; }
.x--w10 { width: 10%; }

/* Images span the enclosing div, regardless of its width. */
.div--img img { width: 100%; }

/* Misc. */
.div--img { margin: 10px auto; }
.div--img img { border: none; }

/* ALIGNMENT */
.alignright, img.alignright {
margin-left: 1.5em;
display: inline;
float: right;
}

This is the HTML code for a regular image, one that spans the page...

<div class="div--img"><img src="../Images/image.jpg" alt="Image"/></div>

And here's the code for an image that's supposed to span just 10% of the page and be floated to the right:

<div class="div--img x--w10 alignright"><img src="../Images/image.jpg" alt="Image"/></div>

Does anyone know how to solve this? Thanks.
SigilBear is offline   Reply With Quote