View Single Post
Old 12-20-2013, 03:35 PM   #41
Liliann
Member
Liliann began at the beginning.
 
Posts: 17
Karma: 10
Join Date: Dec 2013
Device: none
Quote:
Originally Posted by Rev. Bob View Post
I regularly replace cover pages in epubs, for precisely this sort of reason; too many cover images get distorted in certain contexts. Here's what I've come up with for "tall" images:

max-width: 100%;
height: 100%;

I also wrap the image in a DIV that has:

text-align: center;
padding: 0;
margin: 0;
background-color: (something fitting);

...where "something fitting" is either black or a color that blends well with the image's background. For your application, you probably won't need to worry about that. You'll probably want to set page-break-before: always; (and maybe -after as well), though. The end result should be that the image displays on its own page, at full reader height, with the width auto-adjusted to maintain the proper aspect ratio.

I'm away from my computer at the moment, so that's going from memory. If it doesn't work, let me know and I'll post my complete cover page template (all 18 lines) when I get back to it.
Thanks for your comment.
This solution also breaks the image, and the problem is that even if the image fits in one page in portrait mode it breaks in landscape anyway...
Liliann is offline   Reply With Quote