View Single Post
Old 07-28-2009, 04:57 AM   #11
Jellby
frumious Bandersnatch
Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.
 
Jellby's Avatar
 
Posts: 7,515
Karma: 18512745
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
Quote:
Originally Posted by pdurrant View Post
This time, it's illustrations that come in the text. I don't want the illustrations resized with the text this time, but I do want them resized so that they are as big as possible - taking up the whole width of the display if they're a wide, short picture, and taking up the whole height (with white space at the sides) if it's a tall thin picture.
I think "max-height: 100%; max-width: 100%;" should work, but I have the feeling it didn't last time I tried.

Quote:
But when I put this in my document, Safari does nicely resize the picture to fit the width, but when the window width gets less than the width of the picture, it starts to leave gaps above and below the picture, keeping the overall height of the gap the same - I'm guessing this is because of the viewBox dimensions.
I use that SVG code for covers too. My experience is that not all web browsers (HTML or readers) support SVG, and those who do tend to have bugs. So do not trust what you see in a browser if you are creating an ePUB book. A possible theory, from what you say and from what I've seen, is that browsers have problems determining the height of the window/frame/viewable area, so measurements relying on that can be problematic (my proposed max-height:100%, the height:100% in the SVG...). I would test the code in a real ebook reader, or in ADE, at least.
Jellby is offline   Reply With Quote