View Single Post
Old 03-16-2021, 03:03 PM   #1
what
Enthusiast
what began at the beginning.
 
Posts: 28
Karma: 10
Join Date: Mar 2021
Device: none
Do SVGs have to be wrapped in DIVs?

Most sample code shows SVG in ePub wrapped in DIVs, e.g. for a full page image:

Code:
<div>
    <svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" preserveAspectRatio="xMidYMid meet" viewBox="0 0 783 1200" xmlns:xlink="http://www.w3.org/1999/xlink">
        <image width="783" height="1200" xlink:href="../Images/cover.jpg" />
    </svg>
</div>
A few questions:
  1. Is such a wrapper necessary?
  2. Is it necessary both for full page and for inline images?
  3. Is it necessary also if the SVG doesn't contain a pixel image but only vector code?
  4. Does the wrapper have to be styled in any way?
what is offline   Reply With Quote