View Single Post
Old 05-16-2017, 09:36 PM   #2
GeoffR
Wizard
GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.
 
GeoffR's Avatar
 
Posts: 3,821
Karma: 19162882
Join Date: Nov 2012
Location: Te Riu-a-Māui
Device: Kobo Glo
Quote:
Originally Posted by Sam Sahara View Post
Code:
      <img src="../images/animage.jpg" width=100%/>
<img> must have an alt attribute, and the width parameter must have quotes:
Code:
<img src="../images/animage.jpg" width="100%" alt="image"/>
ADE and RMSDK-based readers such as Kobo's ePub reader are very fussy about syntax errors like this, it is a good idea to always test your book with Epubcheck after making changes.

The KePub reader automatically makes an image full-screen if it meets certain criteria. I'm not sure exactly what the criteria are, but roughly: if the html file is the first one displayed in the book, or contains nothing but an image, then it is usually displayed full-screen. You should be able to avoid that by including some visible text in the same file as the image, such as a caption.

Quote:
How can I make a page with an image horizontally centered at 20% from the top, into a kepub and that shows correctly in ADE too?
This should work for ePubs: (image width 33.3% of screen width, horizontally centred, aligned vertically 20% from top of screen):
Code:
<body>
 <div style="text-align:center;padding-top:20%">
  <img src="../images/animage.jpg" alt="image" style="width:33.3%;max-height:80%;"/>
 </div>
</body>
but for KePub I think you will need to make sure there is text or something else visible in the file besides the image, and that it is not the first page of the book. (I haven't done much with KePubs, so someone else might know better.)

Last edited by GeoffR; 05-16-2017 at 09:45 PM. Reason: image width 33.3% of screen width...
GeoffR is offline   Reply With Quote