Quote:
Originally Posted by ElMiko
@RbnJrg - From what I can tell the 4em height isn't ever being applied here; the size is always being determined by the screen width (i.e. scaled to fit at 100% of the screen width). What I'm trying to reproduce is the way Kindle OS handles image heights that would result an an image that doesn't fit the screen (either because it's too tall or because it's too wide). Namely, it will honor the defined height unless the resulting image is too large for the screen, at which point it will resize the image to fit the screen (maintaining its original aspect ratio). For images that are wider than they are tall, this means it will make the image fill 100% of the width of the window; for images that are taller than they are wide, it will make the image fill 100% of the height of the window.
What I'm trying to acheive in epub is a similar kind of contingent behavior whereby the original height parameter is honored UNLESS it results in an image that is too large, at which point it is resized (proportionally) as described above.
To be clear, what I'm looking for may not be possible; I just hoped that since the behavior could be defined (at least in one case) at the OS level, it could also be explicitly defined at the input level...
|
With an svg wrapper the only thing you need to do is to add the height you wish to the style .svg_online.
Your style would be:
Code:
.svg_inline {
display: inline-block;
width: 100%;
height: 4em; /* Or whatever height you wish */
margin: 1em 0;
text-indent: 0;
}
Now, suppose you want a height of 15em; in that case, your output would be:
Since the svg wrapper maintains the proportion of the image, to honor the height, it will add blank spaces to the picture.