Quantcast
Channel: MobileRead Forums
Viewing all articles
Browse latest Browse all 50080

WANTED: Correct image integration via

$
0
0
:welcome:

I am looking for an easy recipe to embed images (covers & others) into ePubs. It should be Aspect Ratio correct & stabil.

Code:

  <div>

    <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="100%" height="100%" viewBox="0 0 500 751" preserveAspectRatio="none">
      <image width="500" height="751" xlink:href="cover.jpeg"/>
    </svg>

  </div>

This code or similar is very usual - but for me incomprehensible & doesn't fit the requirements.

After much testing I create a very simple code: (looks too simple :cool:).
Works generally fine, but not 100% - and I can't find out why!

Code:

<body>

  <img src="cover.jpeg" max-width="100%" height="100%"/>

</body>

Code:

body {
  font-family: Arial, sans-serif;
  display: block;
  margin: 0;
}

Another way of writing the same code
Spoiler:
Code:

<body>

  <img src="cover.jpeg"/>

</body>

img {
  max-width: 100%;
  height: 100%;
}


Viewing all articles
Browse latest Browse all 50080

Latest Images

Trending Articles



Latest Images