Quote:
Originally Posted by momoha
Hey, a) seems to also be working with ePub2! It’s really just that the reset is compulsory. I attached a working ePub2 on this post.
|
Well, well, well. All this time you were using a css template (blitz_C1C4.css) with very important definitions that were affecting the code you wrote. When that file is not included (or not linked to the .xhtml file) then the things doesn't work. And right now, with your epub, I realize about that file. What happens if you don't include blitz_C1C4.css? The code doesn't work with epub2. So, I had to do a bit of research to find all the important code included in blitz_C1C4.css that affect the svg wrapper. I attach two new epubs, one epub2 and one epub3 with the SAME CODE. And both work fine under ADE and Sigil. It's really newfangled this way of including images inside a svg wrapper found by Momoha.
If a moderator is reading this thread, I think s/he should include all this info in the Wiki of the site. Only are used percentages and for all kind of images, no matter the size of them. So, for any .jpg, .png, .gif, whatever format, the new code would be:
1. In the .xhtml file:
Code:
<figure>
<svg style="height: 90vh; width: 100vh" xmlns="http://www.w3.org/2000/svg" height="90%" preserveAspectRatio="xMidYMid meet" version="1.1" width="100%" xmlns:xlink="http://www.w3.org/1999/xlink"><image height="100%" width="100%" xlink:href="../Images/C1.jpg"/></svg>
<figcaption>Insert your caption here</figcaption>
</figure>
and in the .css file:
Code:
body {
margin: 0;
padding: 0;
}
svg {
width: auto;
max-width: 100%;
height: auto;
}
figure {
margin: 0; /*important*/
text-indent: 0;
text-align: center;
display: block; /*very very important*/
line-height: 0px; /*some way important*/
}
figcaption {
font-size: 16px;
line-height: 20px;
text-indent: 0;
display: block; /*very very important*/
}
It's incredible but it's not neccesary any size, just percentages. It works with ADE epub2/epub3 and the ADE bug with epub3 and svg wrappers is overcome.
Quote:
Ok time for bed for me! I’m very curious about why our ePub3 are behaving differently with the same code... I’ll investigate that further tomorrow (or maybe you’ll find an answer before me? ).
|
Yes, that is solved

You can find the answer in my previous post.
Quote:
I have been working in the ePub field for so many years, yet I’ve never been active on this forum, out of... laziness I guess, but now I realise it’s good to exchange with others. I’ll try to be more active, let’s see if I hold up to it or if the laziness comes back
|
Here there are many experts in epubs. And in the .mobi/.kf8/.kfz format. Regarding these last formats, maybe we have the major expert in that field, Hitch. You could learn a lot of things from her.
Regards
Rubén